JPWO2020129140A1 - Inspection equipment and inspection method - Google Patents

Inspection equipment and inspection method Download PDF

Info

Publication number
JPWO2020129140A1
JPWO2020129140A1 JP2019542239A JP2019542239A JPWO2020129140A1 JP WO2020129140 A1 JPWO2020129140 A1 JP WO2020129140A1 JP 2019542239 A JP2019542239 A JP 2019542239A JP 2019542239 A JP2019542239 A JP 2019542239A JP WO2020129140 A1 JPWO2020129140 A1 JP WO2020129140A1
Authority
JP
Japan
Prior art keywords
captured image
image
contour
contour line
inspection
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.)
Granted
Application number
JP2019542239A
Other languages
Japanese (ja)
Other versions
JP6642776B1 (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Application granted granted Critical
Publication of JP6642776B1 publication Critical patent/JP6642776B1/en
Publication of JPWO2020129140A1 publication Critical patent/JPWO2020129140A1/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Abstract

検査システムは、輝度検出部(40)によって検出された検出輝度(An)が、輝度閾値の範囲内か否かを判定する第1判定部(1302)と、撮像画像の輪郭線を取得する輪郭取得部(1303)と、第1判定部(1302)が、検出輝度(An)が輝度閾値の範囲外であると判定した場合に、輪郭取得部(1303)によって取得された撮像画像の輪郭線と、基準画像の輪郭線と、が一致するか判定することにより対象の検査を実行する第2判定部(1304)と、を含む。The inspection system includes a first determination unit (1302) that determines whether or not the detection brightness (An) detected by the brightness detection unit (40) is within the range of the luminance threshold, and a contour that acquires the outline of the captured image. When the acquisition unit (1303) and the first determination unit (1302) determine that the detected luminance (An) is out of the range of the luminance threshold, the contour line of the captured image acquired by the contour acquisition unit (1303). And a second determination unit (1304) that executes the inspection of the target by determining whether or not the contour line of the reference image matches.

Description

本発明は、検査装置、検査システム及び検査方法に関する。 The present invention relates to an inspection device, an inspection system and an inspection method.

従来、検査対象である物品の印刷状態を検査する際に、撮像手段を用いて検査対象を撮像し、撮像された検査対象の画像から、印刷不良が無いか判定する検査システムが知られている。 Conventionally, when inspecting the print state of an article to be inspected, an inspection system is known in which the inspection target is imaged by using an imaging means and the image of the inspection target is judged for printing defects. ..

特許文献1には、移動する検査ステージに載せられた検査対象に照明部から光を照射し、検査対象を撮像手段としての受光部で撮像し、検査対象の欠陥を検査する方法が開示されている。また、検査対象の検出輝度が欠陥検出可能範囲内にあるか否か判定し、検出輝度が欠陥検出可能範囲外であると判定した場合に、照明部から照射する光の照射量、受光部の受光条件(ゲイン)、並びに、受光部の露光時間及び検査ステージの移動速度を調整することで、検査対象の検出輝度を許容範囲に近づけることが開示されている。 Patent Document 1 discloses a method of irradiating an inspection object mounted on a moving inspection stage with light from an illumination unit, imaging the inspection object with a light receiving unit as an imaging means, and inspecting a defect of the inspection object. There is. In addition, it is determined whether or not the detection brightness of the inspection target is within the defect detectable range, and when it is determined that the detection brightness is outside the defect detectable range, the irradiation amount of light emitted from the illumination unit and the light receiving unit It is disclosed that the detection brightness of an inspection target can be brought closer to an allowable range by adjusting the light receiving condition (gain), the exposure time of the light receiving portion, and the moving speed of the inspection stage.

具体的には、特許文献1では、検出輝度が欠陥検出可能な許容範囲外であると判定された場合に、まず、照明部から照射する光の照射量を制御する。その後においても検出輝度が許容範囲外である状態であれば、受光部の受光条件(ゲイン)を制御する。その後においても、まだ、検出輝度が許容範囲外である場合には、受光部の露光時間及び検査ステージの移動速度を調整することで、検出輝度を許容範囲に近づけている。 Specifically, in Patent Document 1, when it is determined that the detection brightness is out of the permissible range in which defects can be detected, first, the irradiation amount of light emitted from the illumination unit is controlled. Even after that, if the detected brightness is out of the permissible range, the light receiving condition (gain) of the light receiving unit is controlled. Even after that, if the detection brightness is still out of the permissible range, the detection brightness is brought closer to the permissible range by adjusting the exposure time of the light receiving portion and the moving speed of the inspection stage.

特開2011−237302号公報Japanese Unexamined Patent Publication No. 2011-237302

検出輝度が低くても、検査対象の輪郭線の取得ができないとは限らないが、特許文献1では、照明部による照射量の調整及び受光部のゲインの調整を行っても検出輝度が許容範囲外であれば、検査ステージの移動速度を遅くしつつ受光部の露光時間を長くさせる制御を行ってしまう。そのため、検出輝度が低いものの検査対象の輪郭線を取得できる状況下にある場合に輪郭線を利用した検査を行っていないという課題があった。 Even if the detection brightness is low, it is not always impossible to obtain the contour line to be inspected. However, in Patent Document 1, the detection brightness is within the permissible range even if the irradiation amount is adjusted by the illumination unit and the gain of the light receiving unit is adjusted. If it is outside, control is performed to lengthen the exposure time of the light receiving portion while slowing down the moving speed of the inspection stage. Therefore, there is a problem that the inspection using the contour line is not performed when the detection brightness is low but the contour line of the inspection target can be obtained.

本発明は、上記問題点を解決するためになされたものであり、対象の輝度が適切な範囲外となった状況下においても対象の輪郭線を取得できる場合には輪郭線を用いた対象の検査を実行できる検査装置、検査システム及び検査方法を提供することを目的とするものである。 The present invention has been made to solve the above problems, and when the contour line of the target can be obtained even under the situation where the brightness of the target is out of the appropriate range, the object using the contour line is used. An object of the present invention is to provide an inspection device, an inspection system, and an inspection method capable of performing an inspection.

第1の発明に係る検査装置は、i)対象の表面の輝度を検出する輝度検出部と、ii)対象を撮像し、対象の撮像画像を取得する撮像部と、iii)輝度検出部によって検出された検出輝度が閾値の範囲内か否かを判定するための輝度閾値と、撮像部によって取得された撮像画像と比較するための基準となる基準画像と、を記憶する記憶部と、iv)輝度検出部によって検出された検出輝度が、輝度閾値の範囲内か否かを判定する第1判定部と、v)撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得部と、vi)第1判定部が、検出輝度が輝度閾値の範囲内であると判定した場合には、基準画像中の画素の画素値である第1画素値と撮像画像中の画素の画素値である第2画素値とを比較して、対象の検査を実行し、第1判定部が、検出輝度が輝度閾値の範囲外であると判定した場合に、輪郭取得部によって取得された撮像画像の第2輪郭線と、基準画像中の輪郭線である第1輪郭線と、が一致するか判定することにより対象の検査を実行する第2判定部と、を備えるものである。 The inspection apparatus according to the first invention is detected by i) a brightness detection unit that detects the brightness of the surface of the target, ii) an imaging unit that captures an image of the target and acquires an captured image of the target, and iii) a brightness detection unit. A storage unit that stores a luminance threshold for determining whether or not the detected luminance is within the range of the threshold, and a reference image as a reference for comparison with the captured image acquired by the imaging unit, and iv). A first determination unit that determines whether or not the detection brightness detected by the brightness detection unit is within the range of the luminance threshold, and v) a contour acquisition unit that acquires a second contour line that is a contour line in the captured image. vi) When the first determination unit determines that the detected luminance is within the range of the luminance threshold, it is the first pixel value which is the pixel value of the pixel in the reference image and the pixel value of the pixel in the captured image. When the target inspection is executed by comparing with the second pixel value and the first determination unit determines that the detection brightness is out of the range of the luminance threshold, the first image captured by the contour acquisition unit is the first. It includes a second determination unit that executes an inspection of an object by determining whether or not the two contour lines and the first contour line, which is the contour line in the reference image, match.

第2の発明に係る検査システムは、i)対象を撮像し、対象の撮像画像を取得する撮像部と、ii)対象を移動させる移動装置と、iii)撮像部によって取得された撮像画像と比較するための基準となる基準画像と、撮像画像のエッジ強度と比較するための輪郭閾値と、を記憶する記憶部と、iv)撮像画像のエッジ強度と撮像画像中の輪郭線である第2輪郭線とを取得する輪郭取得部と、v)輪郭取得部によって取得された撮像画像のエッジ強度が輪郭閾値以上である場合に、基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致するか判定することにより対象の検査を実行する判定部と、vi)輪郭取得部によって取得されたエッジ強度が輪郭閾値未満である場合に、撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整する第1調整部と、vii)輪郭取得部によって取得されたエッジ強度が輪郭閾値未満である場合に、撮像画像が取得された時と比較して、と比較して、移動装置によって対象を移動させる速度である移動速度が遅くなるように調整する第2調整部と、を備えるものである。 The inspection system according to the second invention compares i) an imaging unit that captures an image of the target and acquires the captured image of the target, ii) a moving device that moves the target, and iii) the captured image acquired by the imaging unit. A storage unit that stores a reference image that serves as a reference for the image and a contour threshold value for comparison with the edge strength of the captured image, and iv) the edge strength of the captured image and the second contour that is the contour line in the captured image. The contour acquisition unit that acquires the line, and v) when the edge strength of the captured image acquired by the contour acquisition unit is equal to or greater than the contour threshold value, the first contour line of the reference image and the second contour line of the captured image are When the edge strength acquired by the determination unit that executes the target inspection by determining whether they match and vi) the contour acquisition unit is less than the contour threshold, the image is captured as compared with the time when the captured image is acquired. Compared with the time when the captured image was acquired when the edge strength acquired by the vii) contour acquisition unit was less than the contour threshold, the first adjustment unit that adjusts the exposure time of the part to be longer, and In comparison, it includes a second adjusting unit that adjusts the moving speed, which is the speed at which the target is moved by the moving device, to be slower.

第3の発明に係る検査システムは、i)対象を撮像し、対象の撮像画像を取得する撮像部と、ii)対象を移動させる移動装置と、iii)撮像部によって取得された撮像画像と比較するための基準となる基準画像と、を記憶する記憶部と、iv)撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得部と、v)基準画像中の輪郭線である第1輪郭線と撮像画像の第2輪郭線とが一致する場合に、対象は良品であると判定する判定部と、vi)基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致しない場合に、撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整する第1調整部と、vii)基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致しない場合に、撮像画像が取得された時と比較して、移動装置によって対象を移動させる速度である移動速度が遅くなるように調整する第2調整部と、を備えるものである。 The inspection system according to the third invention compares i) an imaging unit that captures an image of the target and acquires the captured image of the target, ii) a moving device that moves the target, and iii) the captured image acquired by the imaging unit. A storage unit that stores a reference image that serves as a reference, iv) a contour acquisition unit that acquires a second contour line that is a contour line in the captured image, and v) a first contour line that is a reference image. When the 1 contour line and the 2nd contour line of the captured image match, the determination unit that determines that the target is a non-defective product and vi) the 1st contour line of the reference image and the 2nd contour line of the captured image match. If not, the first adjustment unit that adjusts the exposure time of the imaging unit to be longer than when the captured image is acquired, and vii) the first contour line of the reference image and the second contour of the captured image. It is provided with a second adjustment unit that adjusts the movement speed, which is the speed at which the object is moved by the moving device, to be slower than when the captured image is acquired when the lines do not match. ..

第4の発明に係る検査方法は、i)光が照射された対象の表面の輝度を検出する輝度検出ステップと、ii)対象を撮像し、対象の撮像画像を取得する撮像ステップと、iii)輝度検出ステップで検出された検出輝度が、輝度閾値の範囲内か否かを判定する輝度判定ステップと、iv)輝度判定ステップにおいて、検出輝度が輝度閾値の範囲内であると判定された場合に、撮像画像と比較するための基準となる基準画像中の画素の画素値である第1画素値と撮像画像中の画素の画素値である第2画素値とを比較して、対象の検査を実行する第1画像検査ステップと、v)撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得ステップと、vi)輝度判定ステップにおいて、検出輝度が輝度閾値の範囲外であると判定された場合に、輪郭取得ステップにおいて取得された撮像画像の第2輪郭線と、基準画像中の輪郭線である第1輪郭線と、が一致するか判定する第2画像検査ステップと、を備えるものである。 The inspection method according to the fourth invention includes i) a brightness detection step of detecting the brightness of the surface of the object irradiated with light, ii) an imaging step of imaging the object and acquiring an captured image of the object, and iii). When it is determined in the luminance determination step for determining whether or not the detected luminance detected in the luminance detection step is within the luminance threshold range and in the iv) luminance determination step that the detected luminance is within the luminance threshold range. , The target inspection is performed by comparing the first pixel value, which is the pixel value of the pixel in the reference image, which is the reference for comparison with the captured image, and the second pixel value, which is the pixel value of the pixel in the captured image. In the first image inspection step to be executed, v) the contour acquisition step for acquiring the second contour line which is the contour line in the captured image, and vi) the brightness determination step, it is determined that the detected luminance is out of the range of the luminance threshold. When this is done, a second image inspection step of determining whether or not the second contour line of the captured image acquired in the contour acquisition step and the first contour line which is the contour line in the reference image match is provided. It is a thing.

第5の発明に係る検査方法は、i)対象を撮像し、対象の撮像画像を取得する撮像ステップと、ii)撮像画像のエッジ強度と撮像画像の輪郭線である第2輪郭線とを取得する輪郭取得ステップと、iii)輪郭取得ステップによって取得された撮像画像のエッジ強度が、輪郭閾値以上である場合に、撮像画像と比較するための基準となる基準画像中の輪郭線である第1輪郭線と撮像画像の第2輪郭線とが一致するか判定することにより対象の検査を実行する輪郭判定ステップと、iv)輪郭取得ステップによって取得されたエッジ強度が輪郭閾値未満である場合に、撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整し、移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する調整ステップと、を備えるものである。 In the inspection method according to the fifth invention, i) an imaging step of capturing an image of an object and acquiring an captured image of the target, and ii) acquiring an edge strength of the captured image and a second contour line which is a contour line of the captured image. The first contour line in the reference image that serves as a reference for comparison with the captured image when the edge strength of the captured image acquired by the contour acquisition step and the contour acquisition step is equal to or greater than the contour threshold value. When the contour determination step of executing the target inspection by determining whether the contour line and the second contour line of the captured image match, and iv) the edge strength acquired by the contour acquisition step is less than the contour threshold. An adjustment step of adjusting the exposure time of the imaging unit to be longer than when the captured image is acquired, and adjusting the moving speed to be slower, which is the speed at which the object is moved by the moving device. To prepare.

第6の発明に係る検査方法は、i)対象を撮像し、対象の撮像画像を取得する撮像ステップと、ii)撮像画像の輪郭線である第2輪郭線を取得する輪郭取得ステップと、iii)輪郭取得ステップによって取得された撮像画像の第2輪郭線と、撮像画像と比較するための基準となる基準画像中の輪郭線である第1輪郭線と、が一致する場合に、対象は良品であると判定する輪郭判定ステップと、iv)輪郭取得ステップによって取得された撮像画像の第2輪郭線と、基準画像の第1輪郭線と、が一致しない場合に、撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整し、移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する調整ステップと、を備えるものである。 The inspection method according to the sixth invention includes i) an imaging step of capturing an image of an object and acquiring an captured image of the object, ii) a contour acquisition step of acquiring a second contour line which is a contour line of the captured image, and iii. ) When the second contour line of the captured image acquired by the contour acquisition step and the first contour line which is the contour line in the reference image as a reference for comparison with the captured image match, the target is a good product. When the captured image is acquired when the contour determination step for determining that, iv) the second contour line of the captured image acquired by the contour acquisition step, and the first contour line of the reference image do not match. It is provided with an adjustment step of adjusting the exposure time of the imaging unit to be longer and adjusting the moving speed to be slower, which is the speed at which the object is moved by the moving device.

第1及び第4の発明の検査装置及び検査方法は、検出輝度が輝度閾値の範囲内であると判定された場合に、撮像画像と比較するための基準となる基準画像の第1画素値と撮像画像の第2画素値とを比較して、対象の検査を実行し、対象の検出輝度が輝度閾値外である場合に、基準画像の第1輪郭線と撮像画像の第1輪郭線とが一致するか判定することにより対象の検査を実行するようにしたため、対象の輝度が適切な範囲外となった状況下においても対象の輪郭線を取得できる場合には輪郭線を用いた対象の検査を実行できるという効果を有する。また、第2及び第5の発明の検査システム及び検査方法は、撮像画像のエッジ強度が輪郭閾値以上である場合に、基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致するか判定することにより、対象の検査を実行し、撮像画像のエッジ強度が輪郭閾値未満である場合に、撮像画像が取得された時と比較して、撮像部の露光時間を長くし、対象を移動させる速度を遅くするようにしたため、対象の輝度が適切な範囲外となった状況下においても対象の輪郭線を取得できる場合には輪郭線を用いた対象の検査を実行できるという効果を有する。また、第3及び第6の発明の検査システム及び検査方法は、基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致する場合に、対象は良品であると判定し、基準画像の第1輪郭線と撮像画像の第2輪郭線とが一致しない場合に、撮像画像の時と比較して、撮像部の露光時間を長くし、対象を移動させる速度を遅くするようにしたため、対象の輝度が適切な範囲外となった状況下においても対象の輪郭線を取得できる場合には輪郭線を用いた対象の検査を実行できるという効果を有する。 The inspection apparatus and inspection method of the first and fourth inventions are used with the first pixel value of the reference image as a reference for comparison with the captured image when the detection brightness is determined to be within the range of the luminance threshold value. When the target is inspected by comparing with the second pixel value of the captured image and the detected brightness of the target is outside the luminance threshold, the first contour line of the reference image and the first contour line of the captured image are aligned. Since the inspection of the target is performed by determining whether it matches, the inspection of the target using the contour line can be obtained even when the brightness of the target is out of the appropriate range. Has the effect of being able to execute. Further, in the inspection systems and inspection methods of the second and fifth inventions, the first contour line of the reference image and the second contour line of the captured image match when the edge intensity of the captured image is equal to or higher than the contour threshold value. By determining whether or not the target is inspected, when the edge intensity of the captured image is less than the contour threshold, the exposure time of the imaging unit is lengthened as compared with the time when the captured image is acquired, and the target is subjected to. Since the moving speed is slowed down, it has the effect of being able to inspect the target using the contour line if the contour line of the target can be obtained even when the brightness of the target is out of the appropriate range. .. Further, the inspection system and the inspection method of the third and sixth inventions determine that the target is a good product when the first contour line of the reference image and the second contour line of the captured image match, and the reference image. When the first contour line of the image and the second contour line of the captured image do not match, the exposure time of the imaging unit is lengthened and the speed of moving the target is slowed down as compared with the case of the captured image. Even when the brightness of the target is out of the appropriate range, if the contour line of the target can be obtained, there is an effect that the inspection of the target using the contour line can be performed.

本発明の実施の形態1における検査システムの概要構成を示すブロック図であるIt is a block diagram which shows the outline structure of the inspection system in Embodiment 1 of this invention. 本発明の実施の形態1における検査システムで撮像される物品及びトレーを示す平面図であるFIG. 5 is a plan view showing an article and a tray imaged by the inspection system according to the first embodiment of the present invention. 本発明の実施の形態1における検査システムに用いられるPLCのブロック図であるIt is a block diagram of PLC used for the inspection system in Embodiment 1 of this invention. 本発明の実施の形態1における検査システムで用いられる第1基準画像及び第2基準画像を示す図であるIt is a figure which shows the 1st reference image and the 2nd reference image used in the inspection system in Embodiment 1 of this invention. 本発明の実施の形態1における検査処理の概要を示すフローチャートであるIt is a flowchart which shows the outline of the inspection process in Embodiment 1 of this invention. 本発明の実施の形態1における画像検査前処理を示すフローチャートであるIt is a flowchart which shows the image inspection pre-processing in Embodiment 1 of this invention. 本発明の実施の形態1における画像検査前処理の詳細を示すフローチャートであるIt is a flowchart which shows the detail of the image inspection pre-processing in Embodiment 1 of this invention. 本発明の実施の形態1における第1基準画像と輝度と第1エッジ強度との関係を示す図であるIt is a figure which shows the relationship between the 1st reference image, brightness and 1st edge strength in Embodiment 1 of this invention. 本発明の実施の形態1における第1撮像画像と検出輝度と第2エッジ強度との関係を例示する図であるIt is a figure which illustrates the relationship between the 1st captured image, the detection luminance and the 2nd edge intensity in Embodiment 1 of this invention. 本発明の実施の形態1における画像検査処理を示すフローチャートであるIt is a flowchart which shows the image inspection process in Embodiment 1 of this invention. 本発明の実施の形態1における第1画像検査処理を示すフローチャートであるIt is a flowchart which shows the 1st image inspection process in Embodiment 1 of this invention. 本発明の実施の形態1における第1画像検査処理で用いる第2基準画像及び第2撮像画像とRGB濃度値との関係を示す図であるIt is a figure which shows the relationship between the 2nd reference image and the 2nd captured image used in the 1st image inspection processing in Embodiment 1 of this invention, and the RGB density value. 本発明の実施の形態1における第1画像検査処理で用いる第2基準画像及び第2撮像画像とHSV特徴量との関係を示す図であるIt is a figure which shows the relationship between the 2nd reference image and the 2nd captured image used in the 1st image inspection process in Embodiment 1 of this invention, and the HSV feature amount. 本発明の実施の形態1における第2画像検査処理を示すフローチャートであるIt is a flowchart which shows the 2nd image inspection process in Embodiment 1 of this invention. 本発明の実施の形態1における第2基準画像と輝度と第1エッジ強度との関係及び第2撮像画像と検出輝度と第2エッジ強度との関係を示す図であるIt is a figure which shows the relationship between the 2nd reference image, the brightness and the 1st edge intensity in Embodiment 1 of this invention, and the relationship between a 2nd captured image, detection brightness and a 2nd edge intensity. 本発明の実施の形態1における第1輪郭線を取得した後の第2基準画像及び第2輪郭線を取得した後の第2撮像画像を示す図であるIt is a figure which shows the 2nd reference image after having acquired the 1st contour line in Embodiment 1 of this invention, and the 2nd captured image after acquiring a 2nd contour line. 本発明の実施の形態2における検査システムで撮像される物品及びトレーを示す平面図であるFIG. 5 is a plan view showing an article and a tray imaged by the inspection system according to the second embodiment of the present invention. 本発明の実施の形態2における検査システムに用いられるPLCのブロック図であるIt is a block diagram of PLC used for the inspection system in Embodiment 2 of this invention. 本発明の実施の形態2における検査処理の概要を示すフローチャートであるIt is a flowchart which shows the outline of the inspection process in Embodiment 2 of this invention. 本発明の実施の形態2における画像検査前処理を示すフローチャートであるIt is a flowchart which shows the image inspection pre-processing in Embodiment 2 of this invention. 本発明の実施の形態2における画像検査前処理の詳細を示すフローチャートであるIt is a flowchart which shows the detail of the image inspection pre-processing in Embodiment 2 of this invention. 本発明の実施の形態3における画像検査前処理の詳細を示すフローチャートであるIt is a flowchart which shows the detail of the image inspection pre-processing in Embodiment 3 of this invention. 本発明の実施の形態3における画像検査処理を示すフローチャートであるIt is a flowchart which shows the image inspection process in Embodiment 3 of this invention.

実施の形態1.
本発明の実施の形態1における検査システムについて図1から図15Bを用いて説明する。
Embodiment 1.
The inspection system according to the first embodiment of the present invention will be described with reference to FIGS. 1 to 15B.

本発明の実施の形態1の検査システムは、図1に示すように、対象へ光を照射する照明部20と、対象の表面の輝度を検出する輝度検出部としての輝度センサ30と、対象を撮像し、対象の撮像画像を取得する撮像部としてのカメラ40と、コンベア70をX方向に駆動し、対象を移動させる移動装置として機能するモータ80と、照明部20とカメラ40とモータ80とを制御し、撮像画像を用いて画像検査処理を実行するPLC(Programmable Logic Controller)10と、PLC10による画像検査処理の検査結果を表示する表示装置90と、を有している。照明部20、輝度センサ30、カメラ40と、モータ80及び表示装置90は、専用ケーブル等を介してPLC10に接続されている。なお、検査装置は、輝度センサ30と、カメラ40と、PLC10と、を有しており、検査システムの一部を構成する。 As shown in FIG. 1, the inspection system according to the first embodiment of the present invention includes an illumination unit 20 that irradiates an object with light, a brightness sensor 30 as a brightness detection unit that detects the brightness of the surface of the object, and an object. A camera 40 as an imaging unit that captures an image and acquires an captured image of an object, a motor 80 that drives a conveyor 70 in the X direction and functions as a moving device that moves the object, an illumination unit 20, a camera 40, and a motor 80. It has a PLC (Programmable Logic Controller) 10 that controls the image and executes an image inspection process using an captured image, and a display device 90 that displays an inspection result of the image inspection process by the PLC 10. The lighting unit 20, the brightness sensor 30, the camera 40, the motor 80, and the display device 90 are connected to the PLC 10 via a dedicated cable or the like. The inspection device includes a brightness sensor 30, a camera 40, and a PLC 10, and constitutes a part of the inspection system.

モータ80は、トレー60に載せられた状態の検査対象50をトレー60と一緒にX方向に移動させるようにコンベア70を駆動する。検査対象50は、例えば、表面に印刷が施された箱状の物品である。例えば、検査対象50の表面には、図2に示すように、商品名等の文字501、背景模様502、賞味期限の文字503が印刷されており、トレー60の表面には、検査対象50に対応して基準マーク600が設けられている。 The motor 80 drives the conveyor 70 so as to move the inspection target 50 mounted on the tray 60 in the X direction together with the tray 60. The inspection target 50 is, for example, a box-shaped article having a printed surface. For example, as shown in FIG. 2, characters 501 such as a product name, background pattern 502, and expiration date characters 503 are printed on the surface of the inspection target 50, and the inspection target 50 is printed on the surface of the tray 60. A reference mark 600 is provided correspondingly.

照明部20は、例えば、複数のLED(Light Emitting Diode)を含んでおり、PLC10から受信した信号に基づいて、光の照射量を調整し、光の照射対象である検査対象50及びトレー60に対して、複数のLEDから光を照射する。 The lighting unit 20 includes, for example, a plurality of LEDs (Light Emitting Diodes), adjusts the amount of light irradiation based on the signal received from the PLC 10, and sets the inspection target 50 and the tray 60 to be the light irradiation target. On the other hand, light is emitted from a plurality of LEDs.

輝度センサ30は、例えば、フォトダイオードと電流増幅回路とを含んだセンサであり、光の照射対象の一つであるトレー60の表面に設けられた基準マーク600の表面の輝度を検出し、検出輝度をPLC10へ入力する。 The brightness sensor 30 is, for example, a sensor including a photodiode and a current amplifier circuit, and detects and detects the brightness of the surface of the reference mark 600 provided on the surface of the tray 60, which is one of the light irradiation targets. The brightness is input to the PLC 10.

カメラ40は、撮像対象である検査対象50及びトレー60に設けられた基準マーク600を撮像し、撮像画像を取得する。カメラ40は、例えば、CCD(Charge Coupled Device)カメラであり、カラー画像であるRGB画像をPLC10へ入力する。なお、撮像画像からも輝度を算出するため、カメラ40は輝度検出部としても機能する。 The camera 40 images the inspection target 50 to be imaged and the reference mark 600 provided on the tray 60, and acquires the captured image. The camera 40 is, for example, a CCD (Charge Coupled Device) camera, and inputs an RGB image which is a color image to the PLC 10. Since the brightness is calculated from the captured image, the camera 40 also functions as a brightness detection unit.

PLC10は、詳細には後述するが、第1記憶部110と第2記憶部120を含む記憶部と、制御プログラムによって、照明部20、カメラ40、モータ80及び表示装置90等の外部機器を制御し、カメラ40で撮像された検査対象50の撮像画像から色、模様、文字等の検査をするための画像検査処理を実行する制御部130と、照明部20、輝度センサ30、カメラ40、モータ80及び表示装置90等の外部機器とPLC10とを接続するための通信I/F(Interface)部140と、を有する。 The PLC 10 controls external devices such as the lighting unit 20, the camera 40, the motor 80, and the display device 90 by a storage unit including the first storage unit 110 and the second storage unit 120 and a control program, which will be described in detail later. Then, a control unit 130 that executes an image inspection process for inspecting colors, patterns, characters, etc. from the captured image of the inspection target 50 captured by the camera 40, an illumination unit 20, a brightness sensor 30, a camera 40, and a motor. It has a communication I / F (Interface) unit 140 for connecting an external device such as 80 and a display device 90 to the PLC 10.

PLC10は、より詳細には図3に示すように、第1記憶部110と、第2記憶部120と、制御部130と、通信I/F部140と、通信バス150と、を有し、第1記憶部110と、第2記憶部120と、制御部130と、通信I/F部140と、が通信バス150を介して接続されている。第1記憶部110及び第2記憶部120は、それぞれ、例えば、RAM(Random Access Memory)又はROM(Read Only Memory)であり、制御部130は、例えば、プロセッサである。 The PLC 10 includes a first storage unit 110, a second storage unit 120, a control unit 130, a communication I / F unit 140, and a communication bus 150, as shown in FIG. 3 in more detail. The first storage unit 110, the second storage unit 120, the control unit 130, and the communication I / F unit 140 are connected via the communication bus 150. The first storage unit 110 and the second storage unit 120 are, for example, a RAM (Random Access Memory) or a ROM (Read Only Memory), respectively, and the control unit 130 is, for example, a processor.

PLC10の第1記憶部110には、制御プログラム1101、初期設定値1102、輝度閾値1103、第1輪郭閾値1104、第2輪郭閾値1105、第1基準画像1106、及び、第2基準画像1107が記憶される。制御プログラム1101、初期設定値1102、輝度閾値1103、第2輪郭閾値1105、第1基準画像1106、及び、第2基準画像1107のそれぞれは、通信I/F部140に接続可能なエンジニアリングツール(不図示)を用いてユーザによって予め設定される。第1輪郭閾値1104は、後述するように第1基準画像1106に基づいて算出されて記憶される。 The control program 1101, the initial setting value 1102, the brightness threshold 1103, the first contour threshold 1104, the second contour threshold 1105, the first reference image 1106, and the second reference image 1107 are stored in the first storage unit 110 of the PLC 10. Will be done. Each of the control program 1101, the initial setting value 1102, the brightness threshold 1103, the second contour threshold value 1105, the first reference image 1106, and the second reference image 1107 is an engineering tool that can be connected to the communication I / F unit 140. Pre-set by the user using (shown). The first contour threshold value 1104 is calculated and stored based on the first reference image 1106 as described later.

制御プログラム1101は、照明部20、カメラ40、モータ80及び表示装置90等の外部機器を制御し、また、カメラ40で撮像された基準マーク600の撮像画像(以下、第1撮像画像1406ともいう)を用いた画像検査前処理及び検査対象50の撮像画像(以下、第2撮像画像1407ともいう)を用いた画像検査処理を実行するプログラムである。 The control program 1101 controls external devices such as the lighting unit 20, the camera 40, the motor 80, and the display device 90, and also refers to the captured image of the reference mark 600 captured by the camera 40 (hereinafter, also referred to as the first captured image 1406). ) Is a program that executes an image inspection preprocessing and an image inspection process using an image of the inspection target 50 (hereinafter, also referred to as a second image 1407).

初期設定値1102は、照明部20、カメラ40、及び、コンベア70の移動速度を制御するためのモータ80の設定条件の初期値であり、制御プログラム1101を実行して検査対象50の第2撮像画像1407の取得を開始する初期時に設定される設定値である。具体的には、初期設定値1102には、照明部20の光の照射量Inの初期設定値I、カメラ40のゲインGn(感度)の初期設定値G、カメラ40の露光時間ETnの初期設定値ET、モータ80の回転速度Vnの初期設定値Vが含まれる。例えば、光の照射量Inの初期設定値Iは、照明部20の光の照射量の設定可能範囲のうち最も小さい照射量となる設定値であり、カメラ40のゲインGnの初期設定値Gは、カメラ40のゲインGnの設定可能範囲のうち最も小さいゲインとなる設定値であり、カメラ40の露光時間の初期設定値ETは、カメラ40の露光時間の設定可能範囲のうち最も短い露光時間となる設定値であり、モータ80の回転速度Vnの初期設定値Vは、モータ80の回転速度Vnの設定可能範囲のうち最も速い回転速度となる設定値である。The initial setting value 1102 is an initial value of the setting condition of the motor 80 for controlling the moving speeds of the lighting unit 20, the camera 40, and the conveyor 70, and the second imaging of the inspection target 50 is performed by executing the control program 1101. This is a set value set at the initial stage when the acquisition of the image 1407 is started. Specifically, the initial setting value 1102 includes the initial setting value I 0 of the light irradiation amount In of the illumination unit 20, the initial setting value G 0 of the gain Gn (sensitivity) of the camera 40, and the exposure time ETn of the camera 40. The initial setting value ET 0 and the initial setting value V 0 of the rotation speed Vn of the motor 80 are included. For example, the initial setting value I 0 of the light irradiation amount In is a setting value that is the smallest irradiation amount in the settable range of the light irradiation amount of the illumination unit 20, and is the initial setting value G of the gain Gn of the camera 40. 0 is the setting value that is the smallest gain in the settable range of the gain Gn of the camera 40, and the initial setting value ET 0 of the exposure time of the camera 40 is the shortest in the settable range of the exposure time of the camera 40. a set value as the exposure time, the initial setting value V 0 which is the rotational speed Vn of the motor 80 is the set value as the fastest speed of the settable range of the rotational speed Vn of the motor 80.

第1基準画像1106は、図4(a)に示すように、基準マーク600に適切な照射量で光を照射した上で、基準マーク600を撮像して得られた撮像画像であり、輪郭線の取得処理などの画像変換処理を行う前の原画像である。第1基準画像1106は、画像検査を行う際に、コンベア70によって移動する検査対象50を載せたトレー60に設けられた基準マーク600を撮像して得られた第2撮像画像1407と比較して検査対象50の検査が実行可能であるか否かを判定するために用いられる。なお、図8に示す第1撮像画像1406は、画像検査を行う際に、コンベア70によって移動する検査対象50を載せたトレー60に設けられた基準マーク600を撮像して得られた撮像画像であり、詳細については後述する。 As shown in FIG. 4A, the first reference image 1106 is an image obtained by irradiating the reference mark 600 with light at an appropriate irradiation amount and then imaging the reference mark 600, and is a contour line. This is the original image before image conversion processing such as acquisition processing of. The first reference image 1106 is compared with the second image 1407 obtained by imaging the reference mark 600 provided on the tray 60 on which the inspection target 50 moved by the conveyor 70 is placed when performing an image inspection. It is used to determine whether or not the inspection of the inspection target 50 is feasible. The first captured image 1406 shown in FIG. 8 is an captured image obtained by imaging a reference mark 600 provided on a tray 60 on which an inspection target 50 moved by a conveyor 70 is placed when performing an image inspection. Yes, the details will be described later.

なお、基準マーク600は、後述するように、検出輝度が輝度閾値の範囲内であるか否かの判定に用いるため、基準マーク600に適切な照射量で光を照射した上で、基準マーク600を撮像した場合に、適切な輝度範囲となるような色が設定されている。例えば、輝度の値の全範囲が0〜255の場合、中間値の128が検出輝度となる色(例えば灰色)が基準マーク600の格子模様の中央部と四隅の格子に設定され、それ以外の格子は検出輝度が255となる白色に設定される。仮に、中間値の128が検出輝度となるような色ではなく、検出輝度が255に近い色である場合、光の照射量が適切な範囲にあるのか、それとも、照明部20から基準マーク600への光の照射量が過剰であることに起因して基準マーク600の第1撮像画像1406に白飛び(ハレーション)が発生しているのか区別しにくい。逆に、検出輝度が0に近い色である場合、光の照射量が適切な範囲にあるのか、それとも、照明部20から基準マーク600への光の照射量が不足していることに起因して基準マーク600の第1撮像画像1406に黒潰れが発生しているのか区別しにくい。そのため、中間値の128が検出輝度となるような色が基準マーク600の格子模様に中央部と四隅に設定されることで、照明部20から基準マーク600への光の照射量が過剰であること、及び、光の照射量が不足していることの判定に用いることができる。なお、基準マーク600に適切な照射量で光を照射した条件下で基準マーク600を撮像した場合に、適切な輝度範囲となるような色として、中間値の128が検出輝度となる色を一例として説明したが、その他に、検出輝度が100から150の範囲の検出輝度となる色であってもよく、上述したように白飛び及び黒潰れと区別ができる色であればどのような色でもよい。基準マーク600の格子模様の中央部と四隅の格子以外の格子を白色としたが、中央部と四隅の格子とのコントラスト差が大きくとれる色であればどのような色でもよい。また、以下では、理解を容易にするため基準マーク600の格子模様の中央部と四隅の格子に、中間値が検出輝度となる色が設定された場合を説明するが、基準マーク600全体の輝度を検出した際に、基準マーク600全体の輝度値が中間値となるように設定してもよい。なお、図2及び図4(a)等においては、基準マーク600の格子模様の格子間に黒い線で区分けしているが、この黒い線は各格子を図において見易くするために付しているだけである。そのため、格子間に黒い線は無いことを前提として、後述の図7、図8等では検出輝度及びエッジ強度の算出について説明する。 As will be described later, the reference mark 600 is used to determine whether or not the detection brightness is within the range of the luminance threshold value. Therefore, the reference mark 600 is irradiated with light at an appropriate irradiation amount and then the reference mark 600 is used. The color is set so that the brightness range is appropriate when the image is taken. For example, when the entire range of the brightness values is 0 to 255, the color (for example, gray) in which the intermediate value 128 is the detection brightness is set in the center and the four corners of the grid pattern of the reference mark 600, and other than that. The grid is set to white with a detection brightness of 255. If the intermediate value 128 is not a color that becomes the detection brightness but a color whose detection brightness is close to 255, is the light irradiation amount within an appropriate range, or is the illumination unit 20 to the reference mark 600? It is difficult to distinguish whether whiteout (halation) is generated in the first captured image 1406 of the reference mark 600 due to the excessive irradiation amount of the light. On the contrary, when the detected brightness is a color close to 0, it is because the amount of light irradiation is in an appropriate range, or the amount of light irradiation from the illumination unit 20 to the reference mark 600 is insufficient. Therefore, it is difficult to distinguish whether the first captured image 1406 of the reference mark 600 has black crushing. Therefore, the amount of light irradiated from the illumination unit 20 to the reference mark 600 is excessive because the colors such that the intermediate value 128 is the detection brightness are set in the central portion and the four corners in the grid pattern of the reference mark 600. It can be used to determine that the amount of light irradiation is insufficient. An example is a color in which the intermediate value 128 is the detection brightness as a color that has an appropriate brightness range when the reference mark 600 is imaged under the condition that the reference mark 600 is irradiated with light at an appropriate irradiation amount. However, the color may be a color having a detection brightness in the range of 100 to 150, and any color that can be distinguished from overexposure and underexposure as described above may be used. Good. The grids other than the grids at the center and the four corners of the grid pattern of the reference mark 600 are white, but any color may be used as long as the contrast difference between the grids at the center and the four corners can be large. Further, in the following description, in order to facilitate understanding, a case where a color having an intermediate value as the detection brightness is set in the grid at the center and the four corners of the grid pattern of the reference mark 600 will be described, but the brightness of the entire reference mark 600 will be described. When is detected, the brightness value of the entire reference mark 600 may be set to be an intermediate value. In addition, in FIG. 2 and FIG. 4A, etc., the grid pattern of the reference mark 600 is divided by a black line, and this black line is attached to make each grid easier to see in the figure. Only. Therefore, on the premise that there are no black lines between the grids, the calculation of the detected luminance and the edge strength will be described in FIGS. 7 and 8 described later.

また、基準マーク600は、輪郭取得処理を行い適切な輪郭線を取得でき輪郭線を用いた検査ができるか否かの判定に用いるため、基準マーク600中のコントラスト差が明確な模様であることが好ましく、本実施の形態では一例として格子模様を挙げているが、コントラスト差が明確な模様であればどのような模様でもよく、例えば、バーコード、又は、文字等でもよい。 Further, since the reference mark 600 is used for determining whether or not the contour acquisition process can be performed to acquire an appropriate contour line and the inspection using the contour line can be performed, the contrast difference in the reference mark 600 is a clear pattern. In this embodiment, a checkerboard pattern is given as an example, but any pattern may be used as long as the contrast difference is clear, and for example, a bar code or characters may be used.

第2基準画像1107は、図4(b)に示すように、検査対象50と同じ物品の良品に適切な照射量で光を照射した上で、検査対象50と同じ物品の良品を撮像して得られた撮像画像(良品画像)であり、輪郭取得処理を行う前の原画像(第2基準画像1107中の輪郭線である第1輪郭線の取得前の原画像)である。また、第2基準画像1107は、例えば、商品名等の文字1108、背景模様1109及び賞味期限の文字1110の印刷が鮮明に撮像されたRGB画像である。第2基準画像1107は、画像検査を行う際に、コンベア70によって移動する検査対象50の表面を撮像して得られた撮像画像と比較して検査対象50が良品であるか不良品であるかを判定するために用いられる。なお、図11(b)、図12(b)及び図14(b)に示す第2撮像画像1407は、画像検査を行う際に、コンベア70によって移動する検査対象50の表面を撮像して得られた撮像画像であり、詳細については後述する。 As shown in FIG. 4B, the second reference image 1107 irradiates a non-defective product of the same article as the inspection target 50 with light at an appropriate irradiation amount, and then images a non-defective product of the same article as the inspection target 50. It is a obtained captured image (non-defective image) and is an original image before the contour acquisition process is performed (the original image before the acquisition of the first contour line which is the contour line in the second reference image 1107). Further, the second reference image 1107 is, for example, an RGB image in which printing of characters 1108 such as a product name, a background pattern 1109, and characters 1110 with an expiration date is clearly captured. In the second reference image 1107, when the image inspection is performed, whether the inspection target 50 is a good product or a defective product as compared with the captured image obtained by imaging the surface of the inspection target 50 moving by the conveyor 70. Is used to determine. The second captured image 1407 shown in FIGS. 11 (b), 12 (b) and 14 (b) is obtained by imaging the surface of the inspection target 50 moved by the conveyor 70 when performing an image inspection. It is a captured image, and the details will be described later.

輝度閾値1103は、輝度センサ30で検出された基準マーク600の表面の輝度又はカメラ40で撮像された基準マーク600の第1撮像画像1406から算出された輝度(以下、本実施形態では、輝度センサ30が検出した輝度又はカメラ40で撮像された基準マーク600の第1撮像画像1406から算出された輝度を検出輝度Anともいう)が、画像検査処理を行うために必要な輝度閾値1103の範囲内か否か判断するための閾値である。輝度閾値1103は、上限と下限とを含む。検出輝度Anが、上限よりも大きい場合、照明部20から検査対象50及び基準マーク600への光の照射量が過剰であることに起因して、基準マーク600の第1撮像画像1406の白飛び(ハレーション)が発生、又は、第1撮像画像1406中の模様及び文字のコントラスト差が小さくなり、適切に検査対象50の第2撮像画像1407を用いた画像検査ができなくなるため、第1撮像画像1406の白飛びの発生を抑えられるように上限は設定される。また、検出輝度Anが、下限よりも小さい場合、照明部20から検査対象50及び基準マーク600への光の照射量が不足していることに起因して、第1撮像画像1406の黒潰れが発生し、適切に画像検査できなくなるため、第1撮像画像1406の黒潰れの発生を抑えられるように下限は設定される。 The brightness threshold value 1103 is the brightness of the surface of the reference mark 600 detected by the brightness sensor 30 or the brightness calculated from the first captured image 1406 of the reference mark 600 captured by the camera 40 (hereinafter, in the present embodiment, the brightness sensor). The brightness detected by 30 or the brightness calculated from the first captured image 1406 of the reference mark 600 captured by the camera 40 is also referred to as detection brightness An) within the range of the brightness threshold 1103 required for performing the image inspection process. It is a threshold value for determining whether or not. The brightness threshold 1103 includes an upper limit and a lower limit. When the detection brightness An is larger than the upper limit, overexposure of the first captured image 1406 of the reference mark 600 is caused by the excessive irradiation amount of light from the illumination unit 20 to the inspection target 50 and the reference mark 600. (Halation) occurs, or the contrast difference between the pattern and characters in the first captured image 1406 becomes small, and the image inspection using the second captured image 1407 of the inspection target 50 cannot be performed appropriately. Therefore, the first captured image The upper limit is set so that the occurrence of overexposure of 1406 can be suppressed. Further, when the detection brightness An is smaller than the lower limit, the first captured image 1406 is blacked out due to insufficient light irradiation amount from the illumination unit 20 to the inspection target 50 and the reference mark 600. Since it occurs and the image cannot be properly inspected, the lower limit is set so as to suppress the occurrence of black crushing of the first captured image 1406.

第1輪郭閾値1104は、基準マーク600を撮像して得られた第1撮像画像1406から取得されたエッジ強度が、第2撮像画像1407から取得する輪郭線を用いて画像検査処理を行うために必要な強度を有しているか否か判定するための閾値TH1である。 The first contour threshold value 1104 is set so that the edge strength obtained from the first captured image 1406 obtained by imaging the reference mark 600 performs image inspection processing using the contour line acquired from the second captured image 1407. It is a threshold value TH1 for determining whether or not it has a required strength.

第2輪郭閾値1105は、検査対象50の表面を撮像して得られた第2撮像画像1407から取得された輪郭線と、検査対象50と同じ物品の良品を撮像して得られた第2基準画像1107から取得した輪郭線と、の一致度(一致率)を比較して、検査対象50が良品であるか不良品であるかを判定するための閾値TH2である。 The second contour threshold value 1105 is a second reference obtained by imaging the contour line acquired from the second captured image 1407 obtained by imaging the surface of the inspection target 50 and a non-defective product of the same article as the inspection target 50. It is a threshold value TH2 for comparing the degree of coincidence (matching rate) with the contour line acquired from the image 1107 and determining whether the inspection target 50 is a non-defective product or a defective product.

なお、基準画像から取得される輪郭線は、撮像画像から取得される輪郭線と区別するため、以下では第1輪郭線といい、撮像画像から取得される輪郭線は第2輪郭線という。また、基準画像から取得されるエッジ強度は、撮像画像から取得されるエッジ強度と区別するため、以下では第1エッジ強度といい、撮像画像から取得されるエッジ強度は第2エッジ強度という。 The contour line acquired from the reference image is referred to as a first contour line below, and the contour line acquired from the captured image is referred to as a second contour line in order to distinguish it from the contour line acquired from the captured image. Further, the edge strength acquired from the reference image is referred to as the first edge strength below in order to distinguish it from the edge strength acquired from the captured image, and the edge strength acquired from the captured image is referred to as the second edge strength.

PLC10の第2記憶部120は、第1格納領域1203と、第2格納領域1206と、第3格納領域1207と、を有している。第1格納領域1203は、輝度センサ30で検出された基準マーク600の表面の輝度又はカメラ40で撮像された基準マーク600の第1撮像画像1406から算出された輝度である検出輝度Anが格納される記憶領域である。第2格納領域1206は、画像検査を行う際に、コンベア70によって移動する検査対象50を載せたトレー60に設けられた基準マーク600を撮像して得られた第1撮像画像1406が格納される記憶領域である。第3格納領域1207は、画像検査を行う際に、コンベア70によって移動する検査対象50の表面を撮像して得られた第2撮像画像1407が格納される記憶領域である。そして、第1格納領域1203には、輝度センサ30等によって検出された検出輝度Anが記憶される。第2格納領域1206及び第3格納領域1207には、通信I/F部140を介して入力される、カメラ40が撮像した第1撮像画像1406及び第2撮像画像1407がそれぞれ記憶される。 The second storage unit 120 of the PLC 10 has a first storage area 1203, a second storage area 1206, and a third storage area 1207. The first storage area 1203 stores the detection brightness An, which is the brightness of the surface of the reference mark 600 detected by the brightness sensor 30 or the brightness calculated from the first captured image 1406 of the reference mark 600 captured by the camera 40. Storage area. The second storage area 1206 stores the first captured image 1406 obtained by imaging the reference mark 600 provided on the tray 60 on which the inspection target 50 moved by the conveyor 70 is placed when performing an image inspection. It is a storage area. The third storage area 1207 is a storage area in which the second image 1407 obtained by imaging the surface of the inspection target 50 moving by the conveyor 70 when performing an image inspection is stored. Then, the detection brightness An detected by the brightness sensor 30 or the like is stored in the first storage area 1203. The first captured image 1406 and the second captured image 1407 captured by the camera 40, which are input via the communication I / F unit 140, are stored in the second storage area 1206 and the third storage area 1207, respectively.

PLC10の制御部130は、第1記憶部110から制御プログラム1101を読み出して実行することで、外部機器を制御し、また、画像検査前処理及び画像検査処理を実行する。制御部130は、第1記憶部110から制御プログラム1101と初期設定値1102とを読み出して制御プログラム1101中の設定値に初期設定値を設定する初期設定部1300と、輝度センサ30等で検出された検出輝度Anと基準マーク600の第1撮像画像1406と検査対象50の第2撮像画像1407とを、第2記憶部120のうち対応する格納領域にそれぞれ格納する入力取得部1301と、輝度センサ30等で検出された検出輝度Anが輝度閾値1103の範囲内か否かを判定する第1判定部1302と、基準マーク600に関する第1基準画像1106及び第1撮像画像1406、並びに、検査対象50に関する第2基準画像1107及び第2撮像画像1407からそれぞれ第1輪郭線及び第2輪郭線を取得する輪郭取得部1303と、第2判定部1304と、PLC10に接続された外部機器である照明部20、カメラ40及びコンベア70を駆動するモータ80の設定値を調整するため第1調整部1305と、第2調整部1306と、第3調整部1307と、第4調整部1308と、を有する。 The control unit 130 of the PLC 10 controls the external device by reading the control program 1101 from the first storage unit 110 and executing it, and also executes the image inspection pre-processing and the image inspection processing. The control unit 130 is detected by the initial setting unit 1300 that reads the control program 1101 and the initial setting value 1102 from the first storage unit 110 and sets the initial setting value to the set value in the control program 1101, and the luminance sensor 30 or the like. An input acquisition unit 1301 for storing the detected luminance An, the first captured image 1406 of the reference mark 600, and the second captured image 1407 of the inspection target 50 in the corresponding storage areas of the second storage unit 120, and the brightness sensor. The first determination unit 1302 for determining whether or not the detection brightness An detected at 30 or the like is within the range of the brightness threshold 1103, the first reference image 1106 and the first captured image 1406 for the reference mark 600, and the inspection target 50. Contour acquisition unit 1303 that acquires the first contour line and the second contour line from the second reference image 1107 and the second captured image 1407, respectively, the second determination unit 1304, and the illumination unit that is an external device connected to the PLC 10. 20. It has a first adjusting unit 1305, a second adjusting unit 1306, a third adjusting unit 1307, and a fourth adjusting unit 1308 for adjusting the set values of the motor 80 for driving the camera 40 and the conveyor 70.

より詳細には、第2判定部1304は、輪郭取得部1303によって取得された基準マーク600に関する第1基準画像1106及び第1撮像画像1406のエッジ強度(つまり、第1基準画像1106の第1エッジ強度及び第1撮像画像1406の第2エッジ強度)と第1輪郭閾値1104とを用いて、検査対象50に関する第2基準画像1107及び第2撮像画像1407の各輪郭線(つまり、第2基準画像1107の第1輪郭線及び第2撮像画像1407の第2輪郭線)を用いての検査対象50の検査が実行可能か否かを判定する。また、第2判定部1304は、輪郭取得部1303によって取得された検査対象50に関する第2基準画像1107及び第2撮像画像1407の各輪郭線(第2基準画像1107の第1輪郭線及び第2撮像画像1407の第2輪郭線)と第2輪郭閾値1105を用いて、検査対象50が良品であるか不良品であるかを判定する。 More specifically, the second determination unit 1304 determines the edge strength of the first reference image 1106 and the first captured image 1406 (that is, the first edge of the first reference image 1106) with respect to the reference mark 600 acquired by the contour acquisition unit 1303. Using the intensity and the second edge intensity of the first captured image 1406) and the first contour threshold 1104, each contour line (that is, the second reference image) of the second reference image 1107 and the second captured image 1407 with respect to the inspection target 50. It is determined whether or not the inspection of the inspection target 50 can be performed using the first contour line of 1107 and the second contour line of the second captured image 1407). In addition, the second determination unit 1304 sets the contour lines of the second reference image 1107 and the second captured image 1407 (the first contour line and the second contour line of the second reference image 1107) regarding the inspection target 50 acquired by the contour acquisition unit 1303. The second contour line of the captured image 1407) and the second contour threshold value 1105 are used to determine whether the inspection target 50 is a non-defective product or a defective product.

第1調整部1305は、第2判定部1304が第1基準画像1106の第1エッジ強度及び第1撮像画像1406の第2エッジ強度と第1輪郭閾値1104とを用いて、第2基準画像1107の第1輪郭線及び第2撮像画像1407の第2輪郭線から検査対象50の検査が実行不能であると判定した場合、カメラ40の露光時間の設定値である露光時間設定値ETnを変更することで、カメラ40の露光時間を調整する。 In the first adjusting unit 1305, the second determination unit 1304 uses the first edge strength of the first reference image 1106, the second edge strength of the first captured image 1406, and the first contour threshold value 1104, and the second reference image 1107. When it is determined from the first contour line of the first contour line and the second contour line of the second captured image 1407 that the inspection of the inspection target 50 cannot be performed, the exposure time setting value ETn, which is the setting value of the exposure time of the camera 40, is changed. By doing so, the exposure time of the camera 40 is adjusted.

第2調整部1306は、第2判定部1304が第1基準画像1106の第1エッジ強度及び第1撮像画像1406の第2エッジ強度と第1輪郭閾値1104とを用いて、第2基準画像1107の第1輪郭線及び第2撮像画像1407の第2輪郭線から検査対象50の検査が実行不能であると判定した場合、コンベア70を駆動するモータ80の回転速度を変更するよう回転速度の設定値である回転速度設定値Vnを変更することで、検査対象50及びトレー60の移動速度を調整する。 In the second adjusting unit 1306, the second determining unit 1304 uses the first edge strength of the first reference image 1106, the second edge strength of the first captured image 1406, and the first contour threshold value 1104, and the second reference image 1107. When it is determined from the first contour line of the first contour line and the second contour line of the second captured image 1407 that the inspection of the inspection target 50 cannot be performed, the rotation speed is set so as to change the rotation speed of the motor 80 that drives the conveyor 70. By changing the rotation speed set value Vn, which is a value, the moving speeds of the inspection target 50 and the tray 60 are adjusted.

第3調整部1307は、第1判定部1302が輝度センサ30等で検出された検出輝度Anが輝度閾値1103の範囲外であると判定した場合に、照明部20からの光の照射量の設定値である照射量設定値Inを変更することで、照明部20からの光の照射量を調整する。 The third adjusting unit 1307 sets the amount of light emitted from the illuminating unit 20 when the first determining unit 1302 determines that the detected brightness An detected by the brightness sensor 30 or the like is out of the range of the brightness threshold value 1103. By changing the irradiation amount setting value In, which is a value, the irradiation amount of light from the illumination unit 20 is adjusted.

第4調整部1308は、輝度センサ30等で検出された検出輝度Anが輝度閾値1103の範囲外であると第1判定部1302が判定した場合に、カメラ40のゲイン(感度)の設定値であるゲイン設定値Gnを変更することで、カメラ40のゲインを調整する。 The fourth adjusting unit 1308 uses the gain (sensitivity) set value of the camera 40 when the first determining unit 1302 determines that the detected luminance An detected by the luminance sensor 30 or the like is out of the range of the luminance threshold 1103. The gain of the camera 40 is adjusted by changing a certain gain setting value Gn.

なお、PLC10の制御部130の行う機能はプロセッサにより実現される。つまり、初期設定部1300と、入力取得部1301と、第1判定部1302と、輪郭取得部1303と、第2判定部1304と、第1調整部1305と、第2調整部1306と、第3調整部1307と、第4調整部1308のそれぞれの機能はプロセッサにより実現される。 The function performed by the control unit 130 of the PLC 10 is realized by the processor. That is, the initial setting unit 1300, the input acquisition unit 1301, the first determination unit 1302, the contour acquisition unit 1303, the second determination unit 1304, the first adjustment unit 1305, the second adjustment unit 1306, and the third The functions of the adjusting unit 1307 and the fourth adjusting unit 1308 are realized by the processor.

通信I/F部140は、A/D(Analog-to-Digital)変換回路及びD/A(Digital-to-Analog)変換回路を含み、輝度センサ30からの入力値はアナログ信号からデジタル信号に変換され、PLC10から照明部20、モータ80等の外部機器へ出力される出力値はデジタル信号からアナログ信号に変換される。つまり、PLC10への入力信号のうちA/D変換処理が必要な信号であるアナログ信号については、通信I/F部140はアナログ信号からデジタル信号に変換し、PLC10からの出力信号のうちD/A変換処理が必要な信号であるデジタル信号については、デジタル信号からアナログ信号に変換する。なお、カメラ40からの入力信号はデジタル信号でPLC10に入力されるため、通信I/F部140はカメラ40からの入力信号をA/D変換しないよう通信I/F部140中のA/D変換回路を介すことなく通信バス150に送出する。PLC10からカメラ40への出力信号(露光時間の設定値)もデジタル信号であるため、通信I/F部140はカメラ40への出力信号をD/A変換しないよう通信I/F部140中のD/A変換回路を介すことなくカメラ40に送出する。 The communication I / F unit 140 includes an A / D (Analog-to-Digital) conversion circuit and a D / A (Digital-to-Analog) conversion circuit, and the input value from the brightness sensor 30 is changed from an analog signal to a digital signal. The output value that is converted and output from the PLC 10 to an external device such as the illumination unit 20 and the motor 80 is converted from a digital signal to an analog signal. That is, for the analog signal which is the signal that requires A / D conversion processing among the input signals to the PLC 10, the communication I / F unit 140 converts the analog signal to the digital signal, and the D / of the output signals from the PLC 10 A Digital signal, which is a signal that requires conversion processing, is converted from a digital signal to an analog signal. Since the input signal from the camera 40 is input to the PLC 10 as a digital signal, the communication I / F unit 140 A / D in the communication I / F unit 140 so as not to A / D convert the input signal from the camera 40. It is sent to the communication bus 150 without going through the conversion circuit. Since the output signal (exposure time set value) from the PLC 10 to the camera 40 is also a digital signal, the communication I / F unit 140 is in the communication I / F unit 140 so as not to D / A convert the output signal to the camera 40. It is sent to the camera 40 without going through the D / A conversion circuit.

次に、本発明の実施の形態1の検査システムの検査処理について説明する。 Next, the inspection process of the inspection system according to the first embodiment of the present invention will be described.

まず、図5に示すように、検査システムを起動し検査を開始する際、PLC10の初期設定部1300は、第1記憶部110から制御プログラム1101と初期設定値1102を読み出し、制御プログラム1101中に含まれる照明部20、カメラ40及びモータ80の設定値を初期設定値1102に設定する(ステップS1)。すなわち、照明部20の光の照射量設定値Inに初期設定値Iを設定し、カメラ40のゲイン設定値Gnを初期設定値Gに設定し、カメラ40の露光時間設定値ETnを初期設定値ETに設定し、コンベア70の移動速度を制御するためのモータ80の回転速度設定値Vnを初期設定値Vに設定し、照明部20、輝度センサ30、カメラ40及びモータ80の制御を開始する。First, as shown in FIG. 5, when the inspection system is started and the inspection is started, the initial setting unit 1300 of the PLC 10 reads the control program 1101 and the initial setting value 1102 from the first storage unit 110, and enters the control program 1101. The set values of the lighting unit 20, the camera 40, and the motor 80 included are set to the initial set value 1102 (step S1). That is, the initial setting value I 0 is set in the light irradiation amount setting value In of the illumination unit 20, the gain setting value Gn of the camera 40 is set to the initial setting value G 0, and the exposure time setting value ETn of the camera 40 is initially set. The set value ET 0 is set, the rotation speed set value Vn of the motor 80 for controlling the moving speed of the conveyor 70 is set to the initial set value V 0 , and the lighting unit 20, the brightness sensor 30, the camera 40 and the motor 80 are set. Start control.

そして、PLC10の入力取得部1301は、トレー60の表面に設けられた基準マーク600の検出輝度Anを取得し、第2記憶部120の第1格納領域1203に格納し(ステップS2:輝度検出ステップ)、コンベア70によって移動しているトレー60に設けられた基準マーク600の第1撮像画像1406と、検査対象50の表面を撮像して得られた第2撮像画像1407と、を取得し、第2記憶部120の第2格納領域1206及び第3格納領域1207にそれぞれ格納する(ステップS3:撮像ステップ)。 Then, the input acquisition unit 1301 of the PLC 10 acquires the detection brightness An of the reference mark 600 provided on the surface of the tray 60 and stores it in the first storage area 1203 of the second storage unit 120 (step S2: brightness detection step). ), The first captured image 1406 of the reference mark 600 provided on the tray 60 moved by the conveyor 70, and the second captured image 1407 obtained by imaging the surface of the inspection target 50 are acquired, and the first image is obtained. 2 It is stored in the second storage area 1206 and the third storage area 1207 of the storage unit 120, respectively (step S3: imaging step).

そして、PLC10の第1判定部1302と第2判定部1304は、輝度閾値1103と、第2輪郭閾値1105と、第1基準画像1106と、第2基準画像1107と、を第1記憶部110から読み出す(ステップS4)。その後、詳細には後述するが、第1判定部1302と第2判定部1304は、検査対象50の検査が実行可能であるか否かの判定と、照明部20の光の照射量設定値In、カメラ40のゲイン設定値Gn及び露光時間設定値ETn、並びに、モータ80の回転速度設定値Vnの調整のための画像検査前処理(ステップS5)を行う。そして、第1判定部1302又は第2判定部1304が検査対象50の検査が実行可能であると判定した場合に、第2判定部1304は画像検査処理(ステップS6)を行い、ステップS6の画像検査処理の検査結果を通信I/F部140から出力する検査結果出力処理(ステップS7)を行う。 Then, the first determination unit 1302 and the second determination unit 1304 of the PLC 10 transfer the brightness threshold value 1103, the second contour threshold value 1105, the first reference image 1106, and the second reference image 1107 from the first storage unit 110. Read (step S4). After that, as will be described in detail later, the first determination unit 1302 and the second determination unit 1304 determine whether or not the inspection of the inspection target 50 is feasible, and determine the light irradiation amount setting value In of the illumination unit 20. , Image inspection preprocessing (step S5) for adjusting the gain set value Gn and the exposure time set value ETn of the camera 40 and the rotation speed set value Vn of the motor 80 is performed. Then, when the first determination unit 1302 or the second determination unit 1304 determines that the inspection of the inspection target 50 is feasible, the second determination unit 1304 performs an image inspection process (step S6), and the image of step S6 is performed. The inspection result output process (step S7) for outputting the inspection result of the inspection process from the communication I / F unit 140 is performed.

次に、ステップS5の画像検査前処理の詳細について、図6A及び図6Bを参照しながら説明する。 Next, the details of the image inspection preprocessing in step S5 will be described with reference to FIGS. 6A and 6B.

まず、ステップS10(輝度判定ステップ)において、第1判定部1302は、輝度センサ30によって検出された基準マーク600の検出輝度が輝度閾値1103の範囲内にあるか否かを判定する。例えば、以下の式(1)を満たすか否かにより判断する。

|An−At|≦δAt ・・・ 式(1)

ここで、Anは検出輝度であり、Atは輝度閾値1103の範囲の中間値であり、δAtは輝度閾値1103の範囲の中間値から上限又は下限までの許容ずれ量である。なお、輝度閾値1103の範囲は、At±δAtと表すことができ、At+δAtが上限であり、At-δAtが下限である。理解を容易にするために基準マーク600の第1基準画像1106における格子の中央部(色のついた格子)を例にして、以下では説明するが、輝度センサ30の検出輝度Anは基準マーク600の表面全体からの検出輝度となる。まず、基準マーク600に適切な照射量で光を照射した上で基準マーク600を撮像して得られた第1基準画像1106と、これら輝度閾値1103の上限At+δAtと、下限At-δAtと、の関係について図7を参照して説明する。図7の第1基準画像1106のA−A線における第1基準画像1106の画素位置(横軸方向)と輝度(縦軸方向)との関係は、図7の上から1つ目のグラフに示すように、第1基準画像1106の色のついた格子の輝度が中間値Atに設定され、中間値Atを中心として縦軸方向に許容ずれ量δAtを加えた値であるAt+δAtが一点鎖線で示すように上限として設定され、中間値Atから許容ずれ量δAを減じた値であるAt-δAtが一点鎖線で示すように下限として設定された関係となる。例えば、輝度の値の全範囲が0〜255の場合に、前述の基準マーク600の色のついた格子の輝度である128を中間値Atに設定し、許容ずれ量δAtに50を設定し、輝度閾値の範囲を78〜178の範囲としてもよい。
First, in step S10 (luminance determination step), the first determination unit 1302 determines whether or not the detected luminance of the reference mark 600 detected by the luminance sensor 30 is within the range of the luminance threshold 1103. For example, it is determined by whether or not the following equation (1) is satisfied.

| An-At | ≤δAt ... Equation (1)

Here, An is the detected luminance, At is the intermediate value in the range of the luminance threshold 1103, and δAt is the allowable deviation amount from the intermediate value in the range of the luminance threshold 1103 to the upper limit or the lower limit. The range of the luminance threshold 1103 can be expressed as At ± δAt, with At + δAt being the upper limit and At-δAt being the lower limit. In order to facilitate understanding, the central portion (colored grid) of the grid in the first reference image 1106 of the reference mark 600 will be described below as an example, but the detection brightness An of the luminance sensor 30 is the reference mark 600. It is the detection brightness from the entire surface of. First, the first reference image 1106 obtained by irradiating the reference mark 600 with light at an appropriate irradiation amount and then imaging the reference mark 600, the upper limit At + δAt of these luminance thresholds 1103, and the lower limit At-δAt. The relationship will be described with reference to FIG. The relationship between the pixel position (horizontal axis direction) and the brightness (vertical axis direction) of the first reference image 1106 on the AA line of the first reference image 1106 of FIG. 7 is shown in the first graph from the top of FIG. As shown, the brightness of the colored lattice of the first reference image 1106 is set to the intermediate value At, and At + δAt, which is the value obtained by adding the allowable deviation amount δAt in the vertical direction with the intermediate value At as the center, is the alternate long and short dash line. As shown, the upper limit is set, and At-δAt, which is the value obtained by subtracting the permissible deviation amount δA from the intermediate value At, is set as the lower limit as shown by the alternate long and short dash line. For example, when the entire range of the luminance values is 0 to 255, 128, which is the luminance of the colored grid of the reference mark 600 described above, is set as the intermediate value At, and 50 is set as the allowable deviation amount δAt. The range of the brightness threshold value may be the range of 78 to 178.

ステップS10にて、検出輝度Anが輝度閾値1103の範囲内であると第1判定部1302が判定した場合(ステップS10:YES)には、照明部20から検査対象50に照射されている光の照射量は十分であり、カメラ40で撮像した検査対象50の第2撮像画像1407を用いて良否判定を実行できるため、ステップS20に進む。そして、ステップS20では、第1判定部1302は、次の画像検査処理で第1画像検査処理を行うためのフラグである第1画像検査フラグF1を設定して、画像検査前処理を終了する。その後、図5のステップS6に進む。なお、第1画像検査処理は、検査対象50の表面上の印刷状態のうち、文字及びバーコード等のコントラストのはっきりした印刷に加え、色及び模様等も含め詳細な検査を行うための画像検査処理である。ステップS10にて、検出輝度Anが輝度閾値1103の範囲外であると第1判定部1302が判定した場合(ステップS10:NO)には、照明部20から検査対象50に照射されている光の照射量は不十分であり、カメラ40が取得した検査対象50の第2撮像画像1407を用いての第1画像検査処理を実行不能であるため、第1判定部1302は照明部20の光の候補照射量Ixを算出する(ステップS30)。候補照射量Ixは、例えば、以下の式(2)により算出する。

Ix=k×At/An×In ・・・ 式(2)

ここで、Ixは光の候補照射量であり、kは所定の係数であり、Atは輝度閾値1103の範囲の中間値であり、Anは検出輝度であり、InはAn検出時における照明部20の光の照射量の設定値である。なお、係数kは、検出輝度Anが中間値Atより小さい場合(つまり、光の照射量が不足している場合)には、候補照射量Ixが大きくなるように設定され、検出輝度Anが中間値Atより大きい場合(つまり、光の照射量が過剰である場合)には、候補照射量Ixが小さくなるように設定されている。
When the first determination unit 1302 determines in step S10 that the detected luminance An is within the range of the luminance threshold 1103 (step S10: YES), the light emitted from the illumination unit 20 to the inspection target 50 Since the irradiation amount is sufficient and the quality determination can be executed using the second captured image 1407 of the inspection target 50 imaged by the camera 40, the process proceeds to step S20. Then, in step S20, the first determination unit 1302 sets the first image inspection flag F1, which is a flag for performing the first image inspection process in the next image inspection process, and ends the image inspection preprocessing. After that, the process proceeds to step S6 of FIG. The first image inspection process is an image inspection for performing detailed inspection including colors and patterns in addition to printing with clear contrast such as characters and barcodes in the printed state on the surface of the inspection target 50. It is a process. When the first determination unit 1302 determines in step S10 that the detected luminance An is out of the range of the luminance threshold 1103 (step S10: NO), the light emitted from the illumination unit 20 to the inspection target 50 Since the irradiation amount is insufficient and the first image inspection process using the second image 1407 of the inspection target 50 acquired by the camera 40 cannot be executed, the first determination unit 1302 is the light of the illumination unit 20. The candidate irradiation amount Ix is calculated (step S30). The candidate irradiation amount Ix is calculated by, for example, the following formula (2).

Ix = k 1 × At / An × In ・ ・ ・ Equation (2)

Here, Ix is a candidate irradiation amount of light, k 1 is a predetermined coefficient, At is an intermediate value in the range of the brightness threshold 1103, An is the detection brightness, and In is the illumination unit at the time of An detection. It is a set value of the irradiation amount of light of 20. The coefficient k 1 is set so that the candidate irradiation amount Ix becomes large when the detection brightness An is smaller than the intermediate value At (that is, when the light irradiation amount is insufficient), and the detection brightness An becomes large. When it is larger than the intermediate value At (that is, when the irradiation amount of light is excessive), the candidate irradiation amount Ix is set to be small.

続いて、ステップS40においては、第1判定部1302は、算出した候補照射量Ixが、照明部20に対して設定可能な範囲内か否か、つまり候補照射量Ixが設定可能な最小値Imin以上であり、且つ、設定可能な最大値Imax以下であるか否か(Imin≦Ix≦Imax)を判定する。候補照射量Ixが設定可能な範囲内であると第1判定部1302が判定した場合(ステップS40:YES)には、照明部20の照射量設定値InをステップS40で算出した候補照射量Ixに設定し照射量の調整が可能であるため、ステップS50に進む。 Subsequently, in step S40, the first determination unit 1302 determines whether or not the calculated candidate irradiation amount Ix is within the range that can be set for the illumination unit 20, that is, the minimum value Imin that the candidate irradiation amount Ix can set. It is determined whether or not the above is the maximum value that can be set and is equal to or less than the maximum value Imax (Imin ≦ Ix ≦ Imax). When the first determination unit 1302 determines that the candidate irradiation amount Ix is within the settable range (step S40: YES), the irradiation amount setting value In of the illumination unit 20 is calculated in step S40 as the candidate irradiation amount Ix. Since the irradiation amount can be adjusted by setting to, the process proceeds to step S50.

ステップS50では、第3調整部1307が、制御プログラム中の照明部20の照射量設定値Inを候補照射量Ixに設定し直して、図5のステップS2に戻る。これにより、照明部20からの光の照射量設定値Inを候補照射量Ixに設定して光の照射量を調整した後に、再度、図5のステップS2からステップS4を行い、画像検査前処理(ステップS5)のステップS10〜ステップS50を前述と同様に行うこととなる。 In step S50, the third adjustment unit 1307 resets the irradiation amount setting value In of the illumination unit 20 in the control program to the candidate irradiation amount Ix, and returns to step S2 of FIG. As a result, after adjusting the light irradiation amount by setting the light irradiation amount setting value In from the illumination unit 20 to the candidate irradiation amount Ix, steps S2 to S4 of FIG. 5 are performed again to perform pre-imaging processing. Steps S10 to S50 of (step S5) are performed in the same manner as described above.

ステップS30にて、第1判定部1302が、算出した候補照射量Ixが照明部20に対して設定可能な範囲外(ステップS40:NO)であると判定した場合、算出した候補照射量Ixが照明部20に対して設定不可能な設定値であるため、ステップS60に進む。 When the first determination unit 1302 determines in step S30 that the calculated candidate irradiation amount Ix is outside the range that can be set for the illumination unit 20 (step S40: NO), the calculated candidate irradiation amount Ix is Since the set value cannot be set for the illumination unit 20, the process proceeds to step S60.

ステップS60では、第1判定部1302は、検査に適切な検査対象50の第2撮像画像1407を得るためにカメラ40の候補ゲインGxを以下の式(3)により算出する。

Gx=k×At/An×Gn ・・・ 式(3)

ここで、Gxはカメラ40の候補ゲインであり、kは所定の係数であり、Atは輝度閾値1103の範囲の中間値であり、Anは検出輝度であり、GnはAn検出時におけるカメラ40のゲイン設定値である。なお、係数kは、検出輝度Anが中間値Atより小さい場合(つまり、光の照射量が不足している場合)には、候補ゲインGxが大きくなるように設定され、検出輝度Anが中間値Atより大きい場合(つまり、光の照射量が過剰である場合)には、候補ゲインGxが小さくなるように設定されている。
In step S60, the first determination unit 1302 calculates the candidate gain Gx of the camera 40 by the following equation (3) in order to obtain the second captured image 1407 of the inspection target 50 suitable for the inspection.

Gx = k 2 × At / An × Gn ・ ・ ・ Equation (3)

Here, Gx is a candidate gain of the camera 40, k 2 is a predetermined coefficient, At is an intermediate value in the range of the brightness threshold 1103, An is the detection brightness, and Gn is the camera 40 at the time of An detection. Gain setting value of. The coefficient k 2 is set so that the candidate gain Gx becomes large when the detected luminance An is smaller than the intermediate value At (that is, when the amount of light irradiation is insufficient), and the detected luminance An is intermediate. When the value is larger than At (that is, when the amount of light irradiation is excessive), the candidate gain Gx is set to be small.

なお、初回の候補ゲインGxの算出時には、輝度センサ30によって検出された検出輝度Anを用いるが、2回目以降の候補ゲインGxの算出時には、既に照明部20の照射量設定値Inでは検出輝度Anを調整しきれなくなっており輝度センサ30によって検出される検出輝度Anは変化しないため、カメラ40によって撮像された基準マーク600の第1撮像画像1406の全画素から算出された検出輝度Anが用いられる。第1撮像画像1406の検出輝度Anは、第1撮像画像1406中の対象画素のRGB濃度値から以下の式(4)により算出する。対象画素が複数ある場合は、複数の対象画素について以下の式(4)により算出して得た値を平均化して算出する。

An=k×R+k×G+k×B ・・・ 式(4)

ここで、Anは検出輝度であり、Rは対象画素の赤色に関する濃度値であるR濃度値であり、Gは対象画素の緑色に関する濃度値であるG濃度値であり、Bは対象画素の青色に関する濃度値であるB濃度値であり、k、k及びkは所定の係数(k>k>k)である。R濃度値、G濃度値及びB濃度値は、例えば、それぞれ1から255の範囲を取る値である。係数k、k及びkは、例えば、kは0.3、kは0.6、kは0.1等のようにk、k及びkの加算値が1となるような値であってもよい。また、照明部20からの光の照射量が適切な条件下で、第1撮像画像1406の検出輝度Anと輝度センサ30の検出輝度Anとが近い値となるように設定した別の係数kを式(4)の右辺に更に掛け合わせてもよい。
When calculating the candidate gain Gx for the first time, the detection brightness An detected by the luminance sensor 30 is used, but when calculating the candidate gain Gx for the second and subsequent times, the detection brightness An is already set at the irradiation amount setting value In of the illumination unit 20. Since the detection brightness An detected by the brightness sensor 30 does not change, the detection brightness An calculated from all the pixels of the first captured image 1406 of the reference mark 600 captured by the camera 40 is used. .. The detection luminance An of the first captured image 1406 is calculated from the RGB density value of the target pixel in the first captured image 1406 by the following equation (4). When there are a plurality of target pixels, the values obtained by calculating the plurality of target pixels by the following equation (4) are averaged and calculated.

An = k 3 × R + k 4 × G + k 5 × B ・ ・ ・ Equation (4)

Here, An is the detected brightness, R is the R density value which is the density value related to the red color of the target pixel, G is the G density value which is the density value related to the green color of the target pixel, and B is the blue color of the target pixel. It is a B concentration value which is a concentration value with respect to, and k 3 , k 4 and k 5 are predetermined coefficients (k 4 > k 3 > k 5 ). The R concentration value, the G concentration value, and the B concentration value are, for example, values in the range of 1 to 255, respectively. The coefficients k 3 , k 4 and k 5 are, for example, k 3 is 0.3, k 4 is 0.6, k 5 is 0.1, etc., and the added value of k 3 , k 4 and k 5 is 1. It may be a value such that Further, another coefficient k 6 is set so that the detection brightness An of the first captured image 1406 and the detection brightness An of the brightness sensor 30 are close to each other under appropriate conditions for the amount of light emitted from the illumination unit 20. May be further multiplied by the right side of the equation (4).

ステップS70では、第1判定部1302は、算出した候補ゲインGxが、カメラ40に対して設定可能な範囲内にあるか否か、つまり候補ゲインGxが設定可能な最小値Gmin以上であり、且つ、設定可能な最大値Gmax以下であるか否か(Gmin≦Gx≦Gmax)を判定する。候補ゲインGxが設定可能な範囲内であると第1判定部1302が判定した場合(ステップS70:YES)には、カメラ40のゲイン設定値GnにステップS60で算出した候補ゲインGxを設定しゲインの調整が可能であるため、ステップS80に進む。 In step S70, the first determination unit 1302 determines whether or not the calculated candidate gain Gx is within the settable range for the camera 40, that is, the candidate gain Gx is equal to or greater than the settable minimum value Gmin. , It is determined whether or not it is equal to or less than the maximum value Gmax that can be set (Gmin ≦ Gx ≦ Gmax). When the first determination unit 1302 determines that the candidate gain Gx is within the settable range (step S70: YES), the candidate gain Gx calculated in step S60 is set in the gain setting value Gn of the camera 40 to gain. Since the adjustment of is possible, the process proceeds to step S80.

ステップS80では、第4調整部1308が、制御プログラム中のカメラ40のゲイン設定値Gnを候補ゲインGxに設定し直して、図5のステップS2に戻る。これにより、カメラ40のゲイン設定値Gnを候補ゲインGxに設定してカメラ40のゲインを調整した後に、再度、図5のステップS2からステップS4を行い、画像検査前処理(ステップS5)のステップS10〜ステップS80を前述と同様に行うこととなる。 In step S80, the fourth adjusting unit 1308 resets the gain setting value Gn of the camera 40 in the control program to the candidate gain Gx, and returns to step S2 of FIG. As a result, after setting the gain setting value Gn of the camera 40 to the candidate gain Gx and adjusting the gain of the camera 40, steps S2 to S4 of FIG. 5 are performed again, and the step of image inspection preprocessing (step S5) is performed. Steps S10 to S80 are performed in the same manner as described above.

ステップS60にて、第1判定部1302が、算出した候補ゲインGxがカメラ40に対して設定可能な範囲外(ステップS70:NO)であると判定した場合、算出した候補ゲインGxがカメラ40に対して設定不可能な設定値であるため、図6BのステップS90に進む。 When the first determination unit 1302 determines in step S60 that the calculated candidate gain Gx is out of the range that can be set for the camera 40 (step S70: NO), the calculated candidate gain Gx is set to the camera 40. On the other hand, since it is a set value that cannot be set, the process proceeds to step S90 in FIG. 6B.

図6BのステップS90以降の処理は、ステップ10からステップS80を経ても、照明部20の光の照射量設定値Inの調整及びカメラ40のゲイン設定値Gnの調整では検査に適切な検出輝度Anが得られない場合に実行される画像検査前処理である。この処理は、基準マーク600の第1基準画像1106及び第1撮像画像1406から各輪郭線から検査対象50の検査を実行可能であるか否かと判定するために、輪郭取得部1303と第2判定部1304によって実行される。 In the processing after step S90 in FIG. 6B, even if steps 10 to S80 are passed, the detection brightness An suitable for inspection is adjusted by adjusting the light irradiation amount setting value In of the illumination unit 20 and adjusting the gain setting value Gn of the camera 40. This is an image inspection preprocessing that is executed when is not obtained. In this process, the contour acquisition unit 1303 and the second determination are performed in order to determine whether or not the inspection of the inspection target 50 can be executed from each contour line from the first reference image 1106 and the first captured image 1406 of the reference mark 600. Performed by unit 1304.

ステップS90において、輪郭取得部1303は、基準マーク600の第1基準画像1106から第1基準画像1106の第1エッジ強度を取得する。具体的には、第1基準画像1106の第1輪郭線の一部のエッジ強度である第1エッジ強度を算出する。そして、第1基準画像1106の第1エッジ強度から第1輪郭閾値1104を算出し、第1記憶部110に第1輪郭閾値1104を記憶させる。なお、第1基準画像1106から第1エッジ強度を取得する位置は、例えば、図7のA−A線で示すように、輪郭線を取得しやすい任意の位置が予め設定される。 In step S90, the contour acquisition unit 1303 acquires the first edge strength of the first reference image 1106 from the first reference image 1106 of the reference mark 600. Specifically, the first edge strength, which is the edge strength of a part of the first contour line of the first reference image 1106, is calculated. Then, the first contour threshold value 1104 is calculated from the first edge strength of the first reference image 1106, and the first contour threshold value 1104 is stored in the first storage unit 110. The position for acquiring the first edge strength from the first reference image 1106 is set in advance at an arbitrary position where the contour line can be easily acquired, for example, as shown by the line AA in FIG.

第1基準画像1106からの第1エッジ強度の算出方法の例を、図7を参照しながら説明する。図7の第1基準画像1106のA−A線における画素と輝度との関係を示す図7の上から1つ目のグラフにおいては、輝度が例えば第1基準画像1106の横方向の1画素毎に算出される。次に、この算出された輝度が微分されることにより、第1基準画像1106の横方向における輝度の変化の度合いとして第1エッジ強度が算出される。図7の上から2つ目のグラフに第1エッジ強度の算出結果が示される。本例では、左から右への方向において、輝度が減少すると第1エッジ強度は負の値となり、輝度が増加すると第1エッジ強度が正の値となるような変化を表す波形であるエッジ強度波形が得られる。次に、図7の上から3つ目のグラフに示すように、ガウシアンフィルタ等により、エッジ強度波形の平滑化フィルタリング処理が行われる。そして、図7の上から4つ目のグラフに示すように、第1エッジ強度が絶対値化され、かつ、第1エッジ強度が相対値化される。例えば、第1基準画像1106の第1エッジ強度の最大値が100で表されるように、第1エッジ強度が相対値(百分率)に換算される。この第1基準画像1106から求めたエッジ強度であって、エッジ強度波形の極値(つまり、図7の上から4つ目のグラフに示すエッジ強度波形の頂点における縦軸の値)を相対値化したものが、第1基準画像1106の第1エッジ強度である。そして、第1エッジ強度から第1輪郭閾値1104が算出され、例えば、相対値化された第1エッジ強度の80%の値が第1輪郭閾値1104としての閾値TH1に設定されてもよい。第1基準画像1106から第1輪郭閾値1104を求め終わるとステップS100に進む。なお、この第1輪郭閾値1104の算出は、繰り返し実行する必要は無いため、最初の一回だけ実行し、2回目以降はステップS90をスキップしてもよい。また、この第1輪郭閾値1104の算出は、ステップS90ではなく、ステップS90よりも前のタイミングであればいつ行ってもよく、例えば、初期設定値を設定するステップS1で第1輪郭閾値1104を算出してもよいし、エンジニアリングツールにて予め算出しておいた第1輪郭閾値1104を検査開始前にPLC10の第1記憶部110に記憶するようにしてもよい。 An example of a method of calculating the first edge strength from the first reference image 1106 will be described with reference to FIG. 7. In the first graph from the top of FIG. 7, which shows the relationship between the pixels and the brightness on the AA line of the first reference image 1106 of FIG. 7, the brightness is, for example, for each pixel in the horizontal direction of the first reference image 1106. It is calculated to. Next, by differentiating the calculated brightness, the first edge strength is calculated as the degree of change in the brightness of the first reference image 1106 in the lateral direction. The second graph from the top of FIG. 7 shows the calculation result of the first edge strength. In this example, in the direction from left to right, the edge strength is a waveform representing a change in which the first edge strength becomes a negative value when the brightness decreases and the first edge strength becomes a positive value when the brightness increases. A waveform is obtained. Next, as shown in the third graph from the top of FIG. 7, a smoothing filtering process of the edge intensity waveform is performed by a Gaussian filter or the like. Then, as shown in the fourth graph from the top of FIG. 7, the first edge strength is converted into an absolute value, and the first edge strength is converted into a relative value. For example, the first edge strength is converted into a relative value (percentage) so that the maximum value of the first edge strength of the first reference image 1106 is represented by 100. The edge strength obtained from the first reference image 1106, and the extreme value of the edge strength waveform (that is, the value on the vertical axis at the apex of the edge strength waveform shown in the fourth graph from the top of FIG. 7) is a relative value. The result is the first edge strength of the first reference image 1106. Then, the first contour threshold value 1104 is calculated from the first edge strength, and for example, a value of 80% of the relative value of the first edge strength may be set to the threshold value TH1 as the first contour threshold value 1104. When the first contour threshold value 1104 is obtained from the first reference image 1106, the process proceeds to step S100. Since it is not necessary to repeatedly execute the calculation of the first contour threshold value 1104, the calculation may be executed only once at the first time, and step S90 may be skipped from the second time onward. Further, the calculation of the first contour threshold value 1104 may be performed at any time before step S90 instead of step S90. For example, the first contour threshold value 1104 may be calculated in step S1 for setting the initial setting value. It may be calculated, or the first contour threshold value 1104 calculated in advance by the engineering tool may be stored in the first storage unit 110 of the PLC 10 before the start of the inspection.

ステップS100(輪郭取得ステップ)では、輪郭取得部1303は、基準マーク600の第1撮像画像1406を第2記憶部120の第2格納領域1206から読み出し、第1撮像画像1406の第2エッジ強度を取得する。具体的には、第1撮像画像1406の輪郭線の一部のエッジ強度である第2エッジ強度を算出する。第2エッジ強度の算出方法については、図7で示した第1エッジ強度の算出と同様に行うが、第1エッジ強度に対する相対値として算出されるよう相対値化が行われる。なお、第1撮像画像1406から第2エッジ強度を取得する位置は、第1基準画像1106のA−A線に対応する第1撮像画像1406中の位置である。 In step S100 (contour acquisition step), the contour acquisition unit 1303 reads the first captured image 1406 of the reference mark 600 from the second storage area 1206 of the second storage unit 120, and obtains the second edge strength of the first captured image 1406. get. Specifically, the second edge strength, which is the edge strength of a part of the contour line of the first captured image 1406, is calculated. The calculation method of the second edge strength is the same as the calculation of the first edge strength shown in FIG. 7, but the relative value is calculated so as to be calculated as a relative value with respect to the first edge strength. The position where the second edge intensity is acquired from the first captured image 1406 is a position in the first captured image 1406 corresponding to the AA line of the first reference image 1106.

第1撮像画像1406から算出された第2エッジ強度の例を、図8(a)から図8(c)に示す。図8(a)に示す第1撮像画像1406は、図7で示した第1基準画像1106の輝度と同程度の検出輝度を有する撮像画像の例である。図8(a)に示す第1撮像画像1406から、第1基準画像1106のA−A線に対応する位置であるB−B線における検出輝度を用い第2エッジ強度を求めたものが図8(a)の上から2つ目のグラフに示される。図8(a)の上から4つ目のグラフに示す第2エッジ強度は、第1輪郭閾値1104としての閾値TH1以上である。図8(b)に示す第1撮像画像1406は、図7で示した第1基準画像1106の輝度よりも大きい検出輝度を有し、照明部20からの光の照射量が過剰である場合の撮像画像の例である。図8(b)に示す第1撮像画像1406から、第1基準画像1106のA−A線に対応する位置であるB−B線における検出輝度から第2エッジ強度を求めたものが図8(b)の上から4つ目のグラフに示される。図8(b)の上から4つ目のグラフに示す第2エッジ強度は、第1輪郭閾値1104としての閾値TH1未満である。図8(c)に示す第1撮像画像1406は、図7で示した第1基準画像1106の輝度よりも小さい検出輝度を有し、照明部20からの光の照射量が不足している場合の撮像画像の例である。図8(c)に示す第1撮像画像1406から、第1基準画像1106のA−A線に対応する位置であるB−B線における検出輝度から第2エッジ強度を求めたものが図8(c)の上から4つ目のグラフに示される。図8(c)の上から4つ目のグラフに示す第2エッジ強度は、第1輪郭閾値1104としての閾値TH1以上である。なお、第1撮像画像1406から求めたエッジ強度であって、エッジ強度波形の極値(つまり、図8(a)、図8(b)及び図8(c)の上から4つ目のそれぞれのグラフに示すエッジ強度波形の頂点における縦軸の値)を相対値化したものが、第1撮像画像1406の第2エッジ強度である。第1撮像画像1406から第2エッジ強度を求め終わるとステップS110に進む。 Examples of the second edge intensity calculated from the first captured image 1406 are shown in FIGS. 8 (a) to 8 (c). The first captured image 1406 shown in FIG. 8A is an example of a captured image having a detection brightness comparable to the brightness of the first reference image 1106 shown in FIG. 7. From the first captured image 1406 shown in FIG. 8 (a), the second edge intensity was obtained by using the detection luminance on the BB line at the position corresponding to the AA line of the first reference image 1106. It is shown in the second graph from the top of (a). The second edge strength shown in the fourth graph from the top of FIG. 8A is equal to or higher than the threshold value TH1 as the first contour threshold value 1104. The first captured image 1406 shown in FIG. 8B has a detection brightness larger than the brightness of the first reference image 1106 shown in FIG. 7, and the amount of light emitted from the illumination unit 20 is excessive. This is an example of a captured image. From the first captured image 1406 shown in FIG. 8B, the second edge intensity is obtained from the detected luminance on the BB line at the position corresponding to the AA line of the first reference image 1106 (FIG. 8). b) is shown in the fourth graph from the top. The second edge strength shown in the fourth graph from the top of FIG. 8B is less than the threshold value TH1 as the first contour threshold value 1104. The first captured image 1406 shown in FIG. 8C has a detection brightness smaller than the brightness of the first reference image 1106 shown in FIG. 7, and the amount of light emitted from the illumination unit 20 is insufficient. This is an example of the captured image of. From the first captured image 1406 shown in FIG. 8 (c), the second edge intensity is obtained from the detected luminance on the BB line at the position corresponding to the AA line of the first reference image 1106. c) It is shown in the fourth graph from the top. The second edge strength shown in the fourth graph from the top of FIG. 8C is equal to or higher than the threshold value TH1 as the first contour threshold value 1104. The edge intensity obtained from the first captured image 1406, which is the extreme value of the edge intensity waveform (that is, the fourth from the top of FIGS. 8 (a), 8 (b), and 8 (c), respectively). The value on the vertical axis at the apex of the edge intensity waveform shown in the graph of 1406 is a relative value of the second edge intensity of the first captured image 1406. When the second edge strength is obtained from the first captured image 1406, the process proceeds to step S110.

ステップS110では、輪郭取得部1303によって取得された第1撮像画像1406の第2エッジ強度が第1輪郭閾値1104としての閾値TH1以上か否か第2判定部1304が判定する。 In step S110, the second determination unit 1304 determines whether or not the second edge intensity of the first captured image 1406 acquired by the contour acquisition unit 1303 is equal to or greater than the threshold value TH1 as the first contour threshold value 1104.

図8(a)及び図8(c)に示したように第2エッジ強度が第1輪郭閾値1104としての閾値TH1以上である場合(ステップS110:YES)には、第2判定部1304は輪郭線を用いての検査対象50の検査を実行可能であると判定し、ステップS120へ進む。そして、第2判定部1304は、次の画像検査処理で第2画像検査処理を行うためのフラグである第2画像検査フラグF2を設定して、画像検査前処理を終了する。その後、図5のステップS6に進む。なお、第2画像検査処理は、検査対象50の表面上の印刷状態のうち、色及び模様等を除き文字及びバーコード等のコントラストのはっきりした印刷の検査を行うための画像検査処理である。 When the second edge strength is equal to or higher than the threshold value TH1 as the first contour threshold value 1104 as shown in FIGS. 8A and 8C (step S110: YES), the second determination unit 1304 is contoured. It is determined that the inspection of the inspection target 50 using the line is feasible, and the process proceeds to step S120. Then, the second determination unit 1304 sets the second image inspection flag F2, which is a flag for performing the second image inspection process in the next image inspection process, and ends the pre-image inspection process. After that, the process proceeds to step S6 of FIG. The second image inspection process is an image inspection process for inspecting printing with clear contrast such as characters and barcodes except for colors and patterns among the printed states on the surface of the inspection target 50.

図8(b)に示したように第2エッジ強度が第1輪郭閾値1104としての閾値TH1未満である場合(ステップS110:NO)には、第2判定部1304は、検査対象50に関する第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とを用いての検査対象50の検査を実行不能であると判定し、ステップS130に進む。 When the second edge strength is less than the threshold value TH1 as the first contour threshold value 1104 as shown in FIG. 8B (step S110: NO), the second determination unit 1304 is the second regarding the inspection target 50. It is determined that the inspection of the inspection target 50 using the first contour line of the reference image 1107 and the second contour line of the second captured image 1407 cannot be performed, and the process proceeds to step S130.

ステップS130では、第2判定部1304は、カメラ40の候補露光時間ETx及びコンベア70の移動速度を制御するためのモータ80の候補回転速度Vxを算出する。ステップS110にて第2エッジ強度が閾値TH1未満の場合、例えば、照明部20からの光の照射量が少ないことに起因して第1撮像画像1406内のコントラスト差が小さく、第1撮像画像1406の第2エッジ強度が小さくなっていることから、検査対象50の第2撮像画像1407も同様に第2輪郭線の取得がしにくくなっていることが想定される。このため、第2判定部1304は、検査対象50に関する第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とを用いての検査対象50の検査を実行不能であると判定する前と比較して、カメラ40の候補露光時間ETxが長くなるよう、また、コンベア70の移動速度を制御するためのモータ80の候補回転速度Vxが遅くなるように、候補露光時間ETxと候補回転速度Vxを算出する。例えば、第2判定部1304は、カメラ40の候補露光時間ETxが前回設定されていた露光時間よりも長くなるよう、また、コンベア70の移動速度を制御するためのモータ80の候補回転速度Vxが前回設定されていた回転速度よりも遅くなるように算出する。 In step S130, the second determination unit 1304 calculates the candidate exposure time ETx of the camera 40 and the candidate rotation speed Vx of the motor 80 for controlling the moving speed of the conveyor 70. When the second edge intensity is less than the threshold value TH1 in step S110, for example, the contrast difference in the first captured image 1406 is small due to the small amount of light emitted from the illumination unit 20, and the first captured image 1406 Since the second edge strength of the above is small, it is assumed that it is also difficult to acquire the second contour line of the second captured image 1407 of the inspection target 50. Therefore, the second determination unit 1304 cannot perform the inspection of the inspection target 50 using the first contour line of the second reference image 1107 and the second contour line of the second captured image 1407 regarding the inspection target 50. Candidate exposure time ETx so that the candidate exposure time ETx of the camera 40 becomes longer and the candidate rotation speed Vx of the motor 80 for controlling the moving speed of the conveyor 70 becomes slower than before the determination. And the candidate rotation speed Vx are calculated. For example, in the second determination unit 1304, the candidate exposure time ETx of the camera 40 is set to be longer than the previously set exposure time, and the candidate rotation speed Vx of the motor 80 for controlling the moving speed of the conveyor 70 is set. Calculate so that the rotation speed is slower than the previously set rotation speed.

ステップS140では、第2判定部1304は、算出した候補露光時間ETxが、カメラ40に対して設定可能な範囲内か否か判定する。つまり、第2判定部1304は、候補露光時間ETxが設定可能な最小値ETmin以上であり、且つ、設定可能な最大値ETmax以下であるか否か(ETmin≦ETx≦ETmax)を判定し、算出した候補回転速度Vxが、モータ80に対して設定可能な範囲内か否か、つまり候補回転速度Vxが設定可能な最小値Vmin以上であり、且つ、設定可能な最大値Vmax以下であるか否か(Vmin≦Vx≦Vmax)を判定する。第2判定部1304が、候補露光時間ETx及び候補回転速度Vxがともに設定可能な範囲内であると判定した場合(ステップS140:YES)には、カメラ40の露光時間設定値ETnをステップS140で算出した候補露光時間ETxに設定し露光時間の調整が可能であり、また、モータ80の回転速度設定値VnをステップS140で算出した候補回転速度Vxに設定し調整が可能であるため、ステップS150に進む。 In step S140, the second determination unit 1304 determines whether or not the calculated candidate exposure time ETx is within a range that can be set for the camera 40. That is, the second determination unit 1304 determines and calculates whether or not the candidate exposure time ETx is equal to or greater than the settable minimum value ETmin and equal to or less than the settable maximum value ETmax (ETmin ≦ ETx ≦ ETmax). Whether or not the candidate rotation speed Vx is within the settable range for the motor 80, that is, whether or not the candidate rotation speed Vx is equal to or more than the settable minimum value Vmin and is equal to or less than the settable maximum value Vmax. (Vmin ≦ Vx ≦ Vmax) is determined. When the second determination unit 1304 determines that both the candidate exposure time ETx and the candidate rotation speed Vx are within the settable range (step S140: YES), the exposure time set value ETn of the camera 40 is set in step S140. The exposure time can be adjusted by setting the calculated candidate exposure time ETx, and the rotation speed setting value Vn of the motor 80 can be set to the candidate rotation speed Vx calculated in step S140 and adjusted. Therefore, step S150. Proceed to.

ステップS150では、第1調整部1305が、制御プログラム中のカメラ40の露光時間設定値ETnを候補露光時間ETxに設定し直し、モータ80の回転速度設定値Vnを候補回転速度Vxに設定し直し、図5のステップS2に戻る。これにより、カメラ40の露光時間設定値ETnを候補露光時間ETxに、且つ、モータ80の回転速度設定値Vnを候補回転速度Vxに設定してカメラ40の露光時間とモータ80の回転速度を調整した後に、再度、図5のステップS2からステップS4を行い、画像検査前処理(ステップS5)のステップS10〜ステップS150を前述と同様に行うこととなる。なお、ステップS130からステップS150は、調整ステップの一例である。 In step S150, the first adjustment unit 1305 resets the exposure time set value ETn of the camera 40 in the control program to the candidate exposure time ETx, and resets the rotation speed set value Vn of the motor 80 to the candidate rotation speed Vx. , Return to step S2 of FIG. As a result, the exposure time set value ETn of the camera 40 is set to the candidate exposure time ETx, and the rotation speed set value Vn of the motor 80 is set to the candidate rotation speed Vx to adjust the exposure time of the camera 40 and the rotation speed of the motor 80. After that, steps S2 to S4 of FIG. 5 are performed again, and steps S10 to S150 of the image inspection preprocessing (step S5) are performed in the same manner as described above. It should be noted that steps S130 to S150 are examples of adjustment steps.

ステップS130にて、第2判定部1304が、算出された候補露光時間ETx又は候補回転速度Vxがともに設定可能な範囲外であると判定した場合(ステップS140:NO)には、算出した候補露光時間ETxがカメラ40に対して設定不可能な設定値であり、又は、算出した候補回転速度Vxがモータ80に対して設定不可能な設定値であるため、ステップS160に進む。 When the second determination unit 1304 determines in step S130 that both the calculated candidate exposure time ETx and the candidate rotation speed Vx are outside the settable range (step S140: NO), the calculated candidate exposure Since the time ETx is a set value that cannot be set for the camera 40, or the calculated candidate rotation speed Vx is a set value that cannot be set for the motor 80, the process proceeds to step S160.

ステップS160では、カメラ40の露光時間設定値ETnを設定可能な範囲内で最大限長くし、又は、モータ80の回転速度設定値Vnを設定可能な範囲内で最も遅くしたにも関わらず、検査対象50に関する第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とを用いての第2画像検査処理もできないほどに第1撮像画像1406のコントラスト差が小さい。そのため、第2判定部1304は、異常フラグF3を設定し、画像検査前処理を終了する。その後、図5のステップS6に進む。 In step S160, the inspection is performed even though the exposure time set value ETn of the camera 40 is maximized within the settable range or the rotation speed set value Vn of the motor 80 is set to the slowest within the settable range. The contrast difference of the first captured image 1406 is so small that the second image inspection process using the first contour line of the second reference image 1107 and the second contour line of the second captured image 1407 with respect to the object 50 cannot be performed. Therefore, the second determination unit 1304 sets the abnormality flag F3 and ends the image inspection preprocessing. After that, the process proceeds to step S6 of FIG.

次に、図5のステップS6の画像検査処理の詳細について、図9から図15Bを参照しながら説明する。 Next, the details of the image inspection process in step S6 of FIG. 5 will be described with reference to FIGS. 9 to 15B.

まず、図9に示すように、ステップS200では、第2判定部1304は、画像検査前処理にて第1画像検査フラグF1が設定されたか否かを確認する。第1画像検査フラグF1が設定されていると判定された場合(ステップS200:YES)、ステップS210に進み、第1画像検査処理(第1画像検査ステップ)を実行し、画像検査処理を終了する。その後、図5のステップS7に進み、第2判定部1304は、通信I/F部140を介して表示装置90へ第1画像検査結果を出力する。ステップS200で、第1画像検査フラグF1が設定されていないと判定された場合(ステップS200:NO)、ステップS220に進む。なお、第1画像検査処理の詳細は後述する。 First, as shown in FIG. 9, in step S200, the second determination unit 1304 confirms whether or not the first image inspection flag F1 is set in the image inspection preprocessing. When it is determined that the first image inspection flag F1 is set (step S200: YES), the process proceeds to step S210, the first image inspection process (first image inspection step) is executed, and the image inspection process is completed. .. After that, the process proceeds to step S7 of FIG. 5, and the second determination unit 1304 outputs the first image inspection result to the display device 90 via the communication I / F unit 140. If it is determined in step S200 that the first image inspection flag F1 is not set (step S200: NO), the process proceeds to step S220. The details of the first image inspection process will be described later.

ステップS220では、第2判定部1304は、第2画像検査フラグF2が設定されているか否かを確認する。第2画像検査フラグF2が設定されていると判定された場合(ステップS220:YES)、ステップS230へ進み第2画像検査処理(第2画像検査ステップ、輪郭判定ステップ)を実行し、画像検査処理を終了する。その後、図5のステップS7に進み、第2判定部1304は、通信I/F部140を介して表示装置90へ第2画像検査結果を出力する。ステップS220で、第2画像検査フラグF2が設定されていないと判定された場合(ステップS220:NO)、ステップS240に進む。なお、第2画像検査処理の詳細は後述する。 In step S220, the second determination unit 1304 confirms whether or not the second image inspection flag F2 is set. When it is determined that the second image inspection flag F2 is set (step S220: YES), the process proceeds to step S230 to execute the second image inspection process (second image inspection step, contour determination step) and perform the image inspection process. To finish. After that, the process proceeds to step S7 of FIG. 5, and the second determination unit 1304 outputs the second image inspection result to the display device 90 via the communication I / F unit 140. If it is determined in step S220 that the second image inspection flag F2 is not set (step S220: NO), the process proceeds to step S240. The details of the second image inspection process will be described later.

ステップS240では、第2判定部1304は、異常フラグF3が設定されていることを確認する。この場合、検査対象50に関する第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とを用いての第2画像検査処理もできないほどに検査対象50の第2撮像画像1407のコントラスト差が小さくなっていることが想定されるため、画像検査処理を終了する。そして、図5のステップS7に進み、第2判定部1304は、通信I/F部140を介して表示装置90へ検査システムが異常である旨を出力し、ユーザに通知する。 In step S240, the second determination unit 1304 confirms that the abnormality flag F3 is set. In this case, the second image of the inspection target 50 is so large that the second image inspection process using the first contour line of the second reference image 1107 and the second contour line of the second captured image 1407 regarding the inspection target 50 cannot be performed. Since it is assumed that the contrast difference of 1407 is small, the image inspection process is terminated. Then, the process proceeds to step S7 of FIG. 5, and the second determination unit 1304 outputs to the display device 90 via the communication I / F unit 140 that the inspection system is abnormal, and notifies the user.

図9のステップS210における第1画像検査処理は、検査対象50の表面上の印刷状態のうち、文字・バーコード等のコントラストのはっきりした印刷に加え、色模様等も含め詳細な検査を行うための画像検査処理であり、図10と図11を参照しながら説明する。 The first image inspection process in step S210 of FIG. 9 is for performing detailed inspection including color patterns and the like in addition to printing with clear contrast such as characters and barcodes in the printed state on the surface of the inspection target 50. This is the image inspection process of the above, and will be described with reference to FIGS. 10 and 11.

まず、ステップS300では、第2判定部1304は、第1記憶部110より読み出した第2基準画像1107の原画像(第1輪郭線の取得前の第2基準画像1107)から第1画像検査処理の基準となる許容範囲を含む第1色情報を算出する。なお、第1色情報は、第1輪郭線の取得前の第2基準画像1107の原画像の画素の画素値(第1画素値)である。また、図11(a)で示すように、第2基準画像1107には、商品名等の文字1108、背景模様1109及び賞味期限の文字1110の印刷が鮮明に撮像されている。本実施の形態では、商品名等の文字1108は赤色とし、背景模様1109は紺色とし、賞味期限の文字1110は黒色としたものを例示して説明する。第2基準画像1107のC−C線上の各画素を例として説明すると、図11(a)の下のグラフで示すように、第2基準画像1107のC−C線上の各画素について、第2基準画像1107の第1画素値として赤色に関する濃度値であるR濃度値を取得し、R濃度値に対して所定の範囲(縦軸方向)及び画素位置(横軸方向)に対しての所定の範囲、つまり、破線Eで囲まれた領域を許容範囲に設定する。また、第2基準画像1107の第1画素値として緑色に関する濃度値であるG濃度値、青色に関する濃度値であるB濃度値についてもR濃度値と同様に許容範囲を設定する。このような処理を第2基準画像1107の全画素に対して行うことでR濃度値、G濃度値及びB濃度値のそれぞれに許容範囲が設定された第1色情報を求める。なお、R濃度値、G濃度値及びB濃度値の範囲は、例えば、0〜255である。 First, in step S300, the second determination unit 1304 performs the first image inspection process from the original image of the second reference image 1107 (the second reference image 1107 before the acquisition of the first contour line) read from the first storage unit 110. The first color information including the permissible range that serves as a reference for is calculated. The first color information is the pixel value (first pixel value) of the pixels of the original image of the second reference image 1107 before the acquisition of the first contour line. Further, as shown in FIG. 11A, the second reference image 1107 clearly captures the printing of the characters 1108 such as the product name, the background pattern 1109, and the characters 1110 of the expiration date. In the present embodiment, the characters 1108 of the product name and the like are red, the background pattern 1109 is dark blue, and the expiration date character 1110 is black. Taking each pixel on the CC line of the second reference image 1107 as an example, as shown in the graph below FIG. 11A, each pixel on the CC line of the second reference image 1107 has a second second reference image. The R density value, which is a density value related to red color, is acquired as the first pixel value of the reference image 1107, and a predetermined range (vertical axis direction) and a predetermined pixel position (horizontal axis direction) with respect to the R density value are obtained. The range, that is, the area surrounded by the broken line E is set as the allowable range. Further, as the first pixel value of the second reference image 1107, an allowable range is set for the G density value, which is a density value related to green, and the B density value, which is a density value related to blue, in the same manner as the R density value. By performing such processing on all the pixels of the second reference image 1107, the first color information in which the allowable range is set for each of the R density value, the G density value, and the B density value is obtained. The range of the R concentration value, the G concentration value, and the B concentration value is, for example, 0 to 255.

次に、ステップS310では、第2判定部1304は、第2記憶部120の第3格納領域1207から第2撮像画像1407を読み出し、ステップS320に進む。なお、第2撮像画像1407は、図11(b)に示す例では、商品名等の文字1408、背景模様1409、賞味期限の文字1410が印刷されている点は、図11(a)の第2基準画像1107と同じであるが、汚れ1411のような印刷上の不良があるものとする。汚れ1411は、商品名等の文字1408の赤色の塗料がかすれて付着したものである。 Next, in step S310, the second determination unit 1304 reads out the second captured image 1407 from the third storage area 1207 of the second storage unit 120, and proceeds to step S320. In the example shown in FIG. 11B, the second captured image 1407 is printed with the characters 1408 such as the product name, the background pattern 1409, and the expiration date character 1410 in FIG. 11A. 2 It is the same as the reference image 1107, but it is assumed that there is a printing defect such as stain 1411. The stain 1411 is a faint adherence of the red paint of the characters 1408 such as the product name.

次に、ステップS320では、第2判定部1304は、読み出した第2撮像画像1407の原画像(第2輪郭線の取得前の第2撮像画像1407)から第2色情報を算出する。なお、第2色情報は、第2輪郭線の取得前の第2撮像画像1407の原画像の画素の画素値(第2画素値)である。図11(b)に示す第2撮像画像1407の例では、図11(a)の第2基準画像1107のC−C線に対応する位置である第2撮像画像1407のD−D線上の各画素について、第2撮像画像1407の第2画素値として、赤色に関する濃度値であるR濃度値を取得し、同様にG濃度値及びB濃度値を取得する。この場合、図11(b)に示した第2基準画像1107のRGB濃度値とは異なり、汚れ1411のピークFが存在する。 Next, in step S320, the second determination unit 1304 calculates the second color information from the read original image of the second captured image 1407 (the second captured image 1407 before the acquisition of the second contour line). The second color information is the pixel value (second pixel value) of the pixel of the original image of the second captured image 1407 before the acquisition of the second contour line. In the example of the second captured image 1407 shown in FIG. 11B, each of the positions on the DD line of the second captured image 1407 corresponding to the CC line of the second reference image 1107 in FIG. 11A. For the pixels, as the second pixel value of the second captured image 1407, the R density value, which is the density value related to red, is acquired, and the G density value and the B density value are similarly acquired. In this case, unlike the RGB density value of the second reference image 1107 shown in FIG. 11B, the peak F of the stain 1411 is present.

次に、ステップS330では、ステップS300で算出した第1画像検査処理の基準となる許容範囲Eを含む第1色情報とステップS320で算出した第2色情報とを比較し、第2色情報が第1色情報に一致するか否かを第2判定部1304は判定する。具体的には、第2撮像画像1407の第2色情報に含まれているRGB濃度値が、第2基準画像1107の第1色情報に含まれる許容範囲E内か否か判定することによって第2色情報が第1色情報に一致するか判定する。第2色情報が第1色情報に一致する場合(ステップS330:YES)には、ステップS340に進み、検査対象50は良品であると判定される。第2色情報が第1色情報に一致しない場合(ステップS330:NO)には、ステップS350に進み、検査対象50は不良品であると判定される。例えば、図11(b)に示した第2撮像画像1407の場合、汚れ1411のピークFが許容範囲Eに収まらないため、不良品であると判定される。 Next, in step S330, the first color information including the allowable range E which is the reference of the first image inspection process calculated in step S300 is compared with the second color information calculated in step S320, and the second color information is obtained. The second determination unit 1304 determines whether or not the information matches the first color information. Specifically, it is determined by determining whether or not the RGB density value included in the second color information of the second captured image 1407 is within the allowable range E included in the first color information of the second reference image 1107. It is determined whether the two color information matches the first color information. If the second color information matches the first color information (step S330: YES), the process proceeds to step S340, and the inspection target 50 is determined to be a non-defective product. If the second color information does not match the first color information (step S330: NO), the process proceeds to step S350, and the inspection target 50 is determined to be defective. For example, in the case of the second captured image 1407 shown in FIG. 11B, since the peak F of the stain 1411 does not fall within the allowable range E, it is determined to be a defective product.

前述の例では、第1画素値及び第2画素値としてRGB濃度値を用いて、第2基準画像1107から第1画像検査処理の基準となる許容範囲を含む第1色情報を算出し、第2撮像画像1407から第2色情報を算出したが、より人間が検査対象50を見たときの色合いに近いHSV色空間で比較をする場合は、各画素のRGB濃度値を以下の式(5)から式(7)で示すHSV変換式により色相H、彩度S及び明度Vを算出する。なお、これらの色相H、彩度S及び明度Vも、輪郭線を取得する前の原画像の画素値に含まれる。

H=60×(G−R)/(MAX−MIN)+60 (Bが最小の場合)
=60×(G−B)/(MAX−MIN)+180 (Rが最小の場合)
=60×(R−B)/(MAX−MIN)+300 (Gが最小の場合)
・・・式(5)

S=MAX−MIN ・・・ 式(6)

V=MAX ・・・ 式(7)

ここで、Hは色相であり、Sは彩度であり、Vは明度であり、Rは対象画素の赤色に関する濃度値であるR濃度値であり、Gは対象画素の緑色に関する濃度値であるG濃度値であり、Bは対象画素の青色に関する濃度値であるB濃度値であり、MAXはRGBの3つの濃度値のうちの最大の濃度値であり、MINはRGBの3つの濃度値のうち最小の濃度値である。
In the above example, using the RGB density value as the first pixel value and the second pixel value, the first color information including the allowable range that serves as the reference for the first image inspection process is calculated from the second reference image 1107, and the first color information is calculated. 2 The second color information was calculated from the captured image 1407, but when comparing in the HSV color space closer to the hue when a human looks at the inspection target 50, the RGB density value of each pixel is calculated by the following formula (5). ) To the HSV conversion formula represented by the formula (7) to calculate the hue H, the saturation S, and the lightness V. Note that these hue H, saturation S, and lightness V are also included in the pixel values of the original image before the contour line is acquired.

H = 60 × (GR) / (MAX-MIN) +60 (when B is the minimum)
= 60 x (GB) / (MAX-MIN) +180 (when R is the minimum)
= 60 × (RB) / (MAX-MIN) +300 (when G is the minimum)
... Equation (5)

S = MAX-MIN ・ ・ ・ Equation (6)

V = MAX ・ ・ ・ Equation (7)

Here, H is the hue, S is the saturation, V is the brightness, R is the R density value which is the density value related to the red color of the target pixel, and G is the density value related to the green color of the target pixel. G density value, B is the B density value which is the density value related to the blue color of the target pixel, MAX is the maximum density value among the three density values of RGB, and MIN is the three density values of RGB. This is the smallest concentration value.

そして、HSV色空間の色相H、彩度S及び明度Vに基づいて、図12(a)で示すように、RGB濃度値の場合と同様に、色相H、彩度S及び明度Vに対しての所定の範囲(縦軸方向)及び画素位置(横軸方向)に対しての所定の範囲、つまり、破線Eで囲まれた領域を許容範囲に設定する。このような処理を第2基準画像1107の全画素に対して行うことで色相H、彩度S及び明度Vのそれぞれに許容範囲が設定された第1色情報を算出し、図12B(b)から図12B(d)で示すように、第2撮像画像1407から第2色情報を算出し、算出した第1画像検査処理の基準となる許容範囲Eを含む第1色情報と算出した第2色情報とを比較し、第2色情報が第1色情報に一致するか否かを第2判定部1304は判定してもよい。 Then, based on the hue H, saturation S, and lightness V of the HSV color space, as shown in FIG. 12A, with respect to the hue H, saturation S, and lightness V, as in the case of the RGB density value. A predetermined range with respect to a predetermined range (vertical axis direction) and a pixel position (horizontal axis direction), that is, a region surrounded by a broken line E is set as an allowable range. By performing such processing on all the pixels of the second reference image 1107, first color information in which allowable ranges are set for each of hue H, saturation S, and brightness V is calculated, and FIG. 12B (b) As shown in FIG. 12B (d), the second color information was calculated from the second captured image 1407, and the second color information was calculated as the first color information including the allowable range E which is the reference of the calculated first image inspection process. The second determination unit 1304 may determine whether or not the second color information matches the first color information by comparing with the color information.

続いて、図9のステップS230における第2画像検査処理の詳細について、図13から図15を参照しながら説明する。第2画像検査処理は、検査対象50の表面上の印刷状態のうち、色及び模様等を除き文字及びバーコード等のコントラストのはっきりした印刷の検査を行うための画像検査処理である。 Subsequently, the details of the second image inspection process in step S230 of FIG. 9 will be described with reference to FIGS. 13 to 15. The second image inspection process is an image inspection process for inspecting printing with clear contrast such as characters and barcodes except for colors and patterns among the printed states on the surface of the inspection target 50.

まず、ステップS400では、輪郭取得部1303は、第1記憶部110より読み出した第2基準画像1107から第2画像検査処理の基準となる第2基準画像1107の第1輪郭線を取得する。 First, in step S400, the contour acquisition unit 1303 acquires the first contour line of the second reference image 1107, which is the reference of the second image inspection process, from the second reference image 1107 read from the first storage unit 110.

第2基準画像1107の第1輪郭線の取得方法の例を、図14(a)を参照しながら説明する。図14(a)の第2基準画像1107のC−C線における画素と輝度との関係を示す図14(a)の上から1つ目のグラフにおいては、輝度が例えば第2基準画像1107の横方向の1画素毎に算出される。この際に、輝度は前述の式(4)を用いて各画素のRGB濃度値から算出される。次に、この算出された輝度が微分されることにより、第2基準画像1107の横方向における輝度の変化の度合いとして第1エッジ強度が算出される。図14(a)の上から2つ目のグラフに第1エッジ強度の算出結果が示される。本例では、C−C線上を左から右への方向に向かう際、輝度が増加すると第1エッジ強度が正の値となり、輝度が減少すると第1エッジ強度は負の値となり、これを2回繰り返した変化を表す波形であるエッジ強度波形が得られる。次に、図14(a)の上から3つ目のグラフに示すように、ガウシアンフィルタ等により、エッジ強度波形の平滑化フィルタリング処理が行われる。そして、図14(a)の上から4つ目のグラフに示すように、第1エッジ強度が絶対値化され、エッジ強度波形の極値(エッジ強度波形の頂点における縦軸の値)を取る画素の座標値が特定され、その座標値を持つ画素が輪郭線を構成する点として取得される。エッジ強度波形の極値を取る画素の座標値の特定方法としては、例えば、図14(a)の上から4つ目のグラフにおいて横軸の値と第2基準画像1107上の横方向における座標値を対応付けておき、エッジ強度波形の極値における横軸の値から第2基準画像1107上の横方向座標値を求める。なお、第2基準画像1107上の縦方向における縦方向座標値は、第2基準画像1107の下辺からC−C線までの距離を用いることで取得する。このように、エッジ強度波形の極値を取る第2基準画像1107上の座標値を求め、その座標値を持つ画素を輪郭線を構成する点として取得する。以上では、図14(a)の第2基準画像1107のC−C線上の各画素を例に説明したが、ステップS400では、第2基準画像1107の全画素について、例えば、第2基準画像1107の下辺から上辺まで順次走査して同様の処理を行い、第2基準画像1107中の全ての画素について第1エッジ強度を算出し、エッジ強度波形の極値を取る画素の座標値を特定し、その座標値を持つ画素を輪郭線を構成する点として取得することで、図15(a)に示す第2基準画像1107中の第1エッジ強度を有する第1輪郭線が取得される。なお、この第2基準画像1107中の第1輪郭線の取得は、繰り返し実行する必要は無いため、最初の一回だけ実行して第1記憶部110に記憶しておき、2回目以降は第1記憶部110から読み出すようにしてステップS400をスキップしてもよい。また、この第2基準画像1107中の第1輪郭線の取得は、ステップS400ではなく、ステップS400よりも前のタイミングであればいつ行ってもよく、例えば、初期設定値を設定するステップS1で第2基準画像1107中の第1輪郭線を取得してもよいし、エンジニアリングツールを用いて予め取得しておいた第2基準画像1107中の第1輪郭線を検査開始前にPLC10の第1記憶部110に記憶するようにしてもよい。 An example of a method of acquiring the first contour line of the second reference image 1107 will be described with reference to FIG. 14A. In the first graph from the top of FIG. 14 (a) showing the relationship between the pixels and the brightness on the CC line of the second reference image 1107 of FIG. 14 (a), the brightness is, for example, the second reference image 1107. It is calculated for each pixel in the horizontal direction. At this time, the brightness is calculated from the RGB density value of each pixel using the above equation (4). Next, by differentiating the calculated brightness, the first edge strength is calculated as the degree of change in the brightness of the second reference image 1107 in the lateral direction. The calculation result of the first edge strength is shown in the second graph from the top of FIG. 14A. In this example, when the brightness increases in the direction from left to right on the CC line, the first edge strength becomes a positive value, and when the brightness decreases, the first edge strength becomes a negative value. An edge intensity waveform, which is a waveform representing a change repeated many times, can be obtained. Next, as shown in the third graph from the top of FIG. 14A, a smoothing filtering process of the edge intensity waveform is performed by a Gaussian filter or the like. Then, as shown in the fourth graph from the top of FIG. 14A, the first edge intensity is converted into an absolute value, and the extreme value of the edge intensity waveform (the value on the vertical axis at the apex of the edge intensity waveform) is taken. The coordinate values of the pixels are specified, and the pixels having the coordinate values are acquired as points forming the contour line. As a method of specifying the coordinate value of the pixel that takes the extreme value of the edge intensity waveform, for example, in the fourth graph from the top of FIG. 14A, the value on the horizontal axis and the coordinate in the horizontal direction on the second reference image 1107. The values are associated with each other, and the lateral coordinate values on the second reference image 1107 are obtained from the values on the horizontal axis at the extreme values of the edge intensity waveform. The vertical coordinate values in the vertical direction on the second reference image 1107 are obtained by using the distance from the lower side of the second reference image 1107 to the CC line. In this way, the coordinate values on the second reference image 1107 that takes the extreme values of the edge intensity waveform are obtained, and the pixels having the coordinate values are acquired as the points constituting the contour line. In the above, each pixel on the CC line of the second reference image 1107 in FIG. 14A has been described as an example, but in step S400, for all the pixels of the second reference image 1107, for example, the second reference image 1107 The same processing is performed by sequentially scanning from the lower side to the upper side, the first edge strength is calculated for all the pixels in the second reference image 1107, and the coordinate values of the pixels that take the extreme value of the edge strength waveform are specified. By acquiring the pixels having the coordinate values as the points constituting the contour line, the first contour line having the first edge strength in the second reference image 1107 shown in FIG. 15A is acquired. Since it is not necessary to repeatedly execute the acquisition of the first contour line in the second reference image 1107, it is executed only once for the first time and stored in the first storage unit 110, and the second and subsequent times are the second and subsequent times. Step S400 may be skipped by reading from 1 storage unit 110. Further, the acquisition of the first contour line in the second reference image 1107 may be performed at any time before step S400 instead of step S400. For example, in step S1 for setting the initial setting value. The first contour line in the second reference image 1107 may be acquired, or the first contour line in the second reference image 1107 acquired in advance by using an engineering tool may be the first contour line of the PLC 10 before the inspection is started. It may be stored in the storage unit 110.

次に、ステップS410では、輪郭取得部1303は、第2記憶部120の第3格納領域1207から第2撮像画像1407を読み出し、ステップS420に進む。 Next, in step S410, the contour acquisition unit 1303 reads out the second captured image 1407 from the third storage area 1207 of the second storage unit 120, and proceeds to step S420.

次に、ステップS420(輪郭取得ステップ)では、輪郭取得部1303は、読み出した第2撮像画像1407から第2撮像画像1407の第2輪郭線を第2基準画像1107と同様の方法で取得する。図14(b)に示す第2撮像画像1407の例では、汚れ1411が存在するために、第2基準画像1107のC−C線に対応する位置である第2撮像画像1407のD−D線上には図14(b)に示すように汚れ1411に起因する第2エッジ強度Gも取得される。以上では、図14(b)のD−D線上の各画素を例に説明したが、ステップS420では、第2撮像画像1407の全画素を走査して同様の処理を行い、第2撮像画像1407中の全ての画素について第2エッジ強度を算出し、エッジ強度波形の極値を取る画素の座標値を特定し、その座標値を持つ画素を輪郭線を構成する点として取得することで、図15(b)に示す第2撮像画像1407中の第2輪郭線が取得される。 Next, in step S420 (contour acquisition step), the contour acquisition unit 1303 acquires the second contour line of the read second captured image 1407 to the second captured image 1407 in the same manner as the second reference image 1107. In the example of the second captured image 1407 shown in FIG. 14B, since the dirt 1411 is present, it is on the DD line of the second captured image 1407, which is a position corresponding to the CC line of the second reference image 1107. As shown in FIG. 14B, the second edge strength G due to the dirt 1411 is also acquired. In the above, each pixel on the DD line of FIG. 14B has been described as an example, but in step S420, all the pixels of the second captured image 1407 are scanned and the same processing is performed, and the second captured image 1407 is performed. The second edge strength is calculated for all the pixels inside, the coordinate value of the pixel that takes the extreme value of the edge strength waveform is specified, and the pixel having that coordinate value is acquired as a point constituting the contour line. The second contour line in the second captured image 1407 shown in 15 (b) is acquired.

次に、ステップS430では、第2判定部1304は、ステップS420で取得した第2撮像画像1407の第2輪郭線とステップS400で取得した第2基準画像1107の第1輪郭線とを比較し、第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致するか否かを判定する。具体的には、対応する画素の座標位置において、第2撮像画像1407の第2輪郭線と第2基準画像1107の第1輪郭線とを画素毎に一致するか判断し、全画素に対する一致度(一致率)が第2輪郭閾値以上か否かを判定する。なお、第2撮像画像1407の第2輪郭線と第2基準画像1107の第1輪郭線とが一致するか否かの判定方法は、第2基準画像1107の第1輪郭線を構成する画素の座標値と、第1輪郭線と対応する第2撮像画像1407の第2輪郭線を構成する画素の座標値とが完全に一致するか否かで判定する方法であってもよいし、第2撮像画像1407の第2輪郭線の画素の座標上の位置が対応する第2基準画像1107の第1輪郭線の画素の座標上の位置から所定距離範囲内にあれば一致すると判定する方法であってもよい。 Next, in step S430, the second determination unit 1304 compares the second contour line of the second captured image 1407 acquired in step S420 with the first contour line of the second reference image 1107 acquired in step S400. It is determined whether or not the second contour line of the second captured image 1407 matches the first contour line of the second reference image 1107. Specifically, at the coordinate positions of the corresponding pixels, it is determined whether the second contour line of the second captured image 1407 and the first contour line of the second reference image 1107 match for each pixel, and the degree of coincidence with respect to all the pixels. It is determined whether or not (match rate) is equal to or greater than the second contour threshold value. The method for determining whether or not the second contour line of the second captured image 1407 and the first contour line of the second reference image 1107 match is the method of determining whether or not the first contour line of the second reference image 1107 is a pixel constituting the first contour line of the second reference image 1107. It may be a method of determining whether or not the coordinate values and the coordinate values of the pixels constituting the second contour line of the second captured image 1407 corresponding to the first contour line completely match, or the second method. It is a method of determining that the positions of the pixels of the second contour line of the captured image 1407 match if they are within a predetermined distance range from the positions of the pixels of the first contour line of the corresponding second reference image 1107. You may.

第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致する場合(ステップS430:YES)には、ステップS440に進み、検査対象50は良品であると判定される。第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致しない場合(ステップS430:NO)には、ステップS450に進み、検査対象50は不良品であると判定される。例えば、図15(b)に示した第2撮像画像1407の場合、汚れ1411に対応する第2輪郭線が第2基準画像1107の第1輪郭線に一致せず、一致度(一致率)が第2輪郭閾値未満となり、不良品であると判定される。 When the second contour line of the second captured image 1407 matches the first contour line of the second reference image 1107 (step S430: YES), the process proceeds to step S440, and the inspection target 50 is determined to be a good product. .. If the second contour line of the second captured image 1407 does not match the first contour line of the second reference image 1107 (step S430: NO), the process proceeds to step S450, and the inspection target 50 is determined to be defective. To. For example, in the case of the second captured image 1407 shown in FIG. 15B, the second contour line corresponding to the stain 1411 does not match the first contour line of the second reference image 1107, and the degree of coincidence (match rate) is high. It becomes less than the second contour threshold value and is determined to be a defective product.

このように、第1画像検査又は第2画像検査では、第2基準画像1107と第2撮像画像1407とに基づいて、検査対象50が良品か不良品かの判定が行われ、第1画像検査及び第2画像検査の検査結果は通信I/F部140を介して表示装置90へ出力される。 As described above, in the first image inspection or the second image inspection, it is determined whether the inspection target 50 is a good product or a defective product based on the second reference image 1107 and the second captured image 1407, and the first image inspection The inspection result of the second image inspection is output to the display device 90 via the communication I / F unit 140.

本実施の形態1における検査システムにあっては、輝度検出部としてのカメラ40の撮像した基準マーク600の第1撮像画像1406から求めた検出輝度Anが輝度閾値1103の範囲内であると第1判定部1302が判定した場合、第2基準画像1107中の第1画素値と第2撮像画像1407中の第2画素値とを比較して、対象の検査を実行し、検出輝度Anが輝度閾値1103の範囲外であると第1判定部1302が判定した場合、第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とが一致するか判定することにより対象の検査を実行する。そのため、検査対象50の表面の輝度が適切な範囲内となる状況下においては、第2基準画像1107の第1画素値と第2撮像画像1407の第2画素値とを比較することで対象の詳細な検査を実行でき、検査対象50の表面の輝度が適切な範囲外となる状況下においても検査対象50の輪郭線を取得できる場合には、移動装置の移動速度を遅くすることなく輪郭線を用いた対象の検査を実行できるという効果を奏する。 In the inspection system according to the first embodiment, if the detection brightness An obtained from the first captured image 1406 of the reference mark 600 imaged by the camera 40 as the brightness detection unit is within the range of the brightness threshold 1103, the first When the determination unit 1302 determines, the first pixel value in the second reference image 1107 is compared with the second pixel value in the second captured image 1407, the target inspection is executed, and the detection brightness An is the brightness threshold value. When the first determination unit 1302 determines that the range is out of the range of 1103, the target inspection is performed by determining whether the first contour line of the second reference image 1107 and the second contour line of the second captured image 1407 match. To execute. Therefore, under the condition that the brightness of the surface of the inspection target 50 is within an appropriate range, the target is obtained by comparing the first pixel value of the second reference image 1107 with the second pixel value of the second captured image 1407. If the detailed inspection can be performed and the contour line of the inspection target 50 can be obtained even when the brightness of the surface of the inspection target 50 is out of the appropriate range, the contour line without slowing down the moving speed of the moving device. It has the effect of being able to perform an inspection of the target using.

また、本実施の形態1における検査システムにあっては、検査対象50ではなく、基準マーク600の第1撮像画像1406から求めた検出輝度Anが輝度閾値1103の範囲内か否か第1判定部1302が判定する。そして、輪郭取得部1303は基準マーク600の第1撮像画像1406から第2エッジ強度を取得し、第2判定部1304が第1撮像画像1406の第2エッジ強度が第1輪郭閾値1104以上であるか判定するようにしている。このように、基準マーク600を用いて輝度判定及び輪郭線の取得可否の判定を行うため、検査対象50の影響を受けることなく輝度判定の精度及び輪郭線の取得可否の判定の精度を向上できるという効果を奏する。 Further, in the inspection system according to the first embodiment, the first determination unit determines whether or not the detection brightness An obtained from the first captured image 1406 of the reference mark 600 is within the range of the brightness threshold 1103 instead of the inspection target 50. 1302 determines. Then, the contour acquisition unit 1303 acquires the second edge strength from the first captured image 1406 of the reference mark 600, and the second determination unit 1304 has the second edge strength of the first captured image 1406 of the first contour threshold value 1104 or more. I am trying to judge. In this way, since the luminance determination and the determination of whether or not the contour line can be acquired are performed using the reference mark 600, the accuracy of the luminance determination and the accuracy of the determination of whether or not the contour line can be acquired can be improved without being affected by the inspection target 50. It plays the effect.

更に、本実施の形態1における検査システムにあっては、輪郭取得部1303は基準マーク600の第1撮像画像1406から第2エッジ強度を取得し、第2判定部1304が第1撮像画像1406の第2エッジ強度が第1輪郭閾値以上であると判定した場合、第2基準画像1107中の第1輪郭線と第2撮像画像1407中の第2輪郭線とが一致するか判定することにより検査対象50の検査を実行し、第2判定部1304が第1撮像画像1406の第2エッジ強度が第1輪郭閾値未満であると判定した場合、第1撮像画像1406が取得された時と比較して、第1調整部1305はカメラ40の露光時間設定値ETnが長くなるように調整し、第2調整部1306は検査対象50を移動させる際の移動速度が遅くなるようにモータ80の回転速度設定値Vnを調整する。そのため、検査対象50の輝度が適切な範囲外となった状況下においても検査対象50の輪郭線を取得できる場合には輪郭線を用いた検査対象50の検査を実行でき、検査対象50の輪郭線を取得できない場合に、カメラ40の露光時間設定値ETnが長くなるように、検査対象50の移動速度が遅くなるように調整して、輪郭線を取得できる撮像環境に近づけることができるという効果を奏する。 Further, in the inspection system according to the first embodiment, the contour acquisition unit 1303 acquires the second edge strength from the first captured image 1406 of the reference mark 600, and the second determination unit 1304 is the first captured image 1406. When it is determined that the second edge strength is equal to or higher than the first contour threshold, the inspection is performed by determining whether the first contour line in the second reference image 1107 and the second contour line in the second captured image 1407 match. When the inspection of the target 50 is executed and the second determination unit 1304 determines that the second edge intensity of the first captured image 1406 is less than the first contour threshold value, it is compared with the time when the first captured image 1406 is acquired. The first adjustment unit 1305 adjusts the exposure time set value ETn of the camera 40 to be longer, and the second adjustment unit 1306 adjusts the rotation speed of the motor 80 so that the movement speed when moving the inspection target 50 becomes slower. Adjust the set value Vn. Therefore, if the contour line of the inspection target 50 can be obtained even when the brightness of the inspection target 50 is out of the appropriate range, the inspection of the inspection target 50 using the contour line can be executed, and the contour of the inspection target 50 can be executed. When the line cannot be acquired, the effect is that the moving speed of the inspection target 50 can be adjusted to be slow so that the exposure time set value ETn of the camera 40 becomes long, and the image can be brought closer to an imaging environment in which the contour line can be acquired. Play.

実施の形態2.
続いて、本発明の実施の形態2における検査システムについて図16から図19Bを用いて説明する。なお、実施の形態1と異なる構成及びステップの番号にはAを追加している。実施の形態1と同じ構成については、同一の符号を付し、詳細な説明は省略する。
Embodiment 2.
Subsequently, the inspection system according to the second embodiment of the present invention will be described with reference to FIGS. 16 to 19B. In addition, A is added to the configuration and the step number different from those of the first embodiment. The same components as those in the first embodiment are designated by the same reference numerals, and detailed description thereof will be omitted.

本発明の実施の形態2における検査システムにおいては、図16に示すようにトレー60に基準マーク600が無い状態で検査対象50の検査を行う点が実施の形態1に対して異なる。そのため、図17に示すように、実施の形態1に対して、PLC10の第1記憶部110から基準マーク600の第1基準画像1106が除かれた第1記憶部110Aと、基準マーク600の第1撮像画像1406を格納する第2格納領域1206が除かれた第2記憶部120Aと、を備える点が異なる。 The inspection system according to the second embodiment of the present invention is different from the first embodiment in that the inspection target 50 is inspected without the reference mark 600 on the tray 60 as shown in FIG. Therefore, as shown in FIG. 17, with respect to the first embodiment, the first storage unit 110A in which the first reference image 1106 of the reference mark 600 is removed from the first storage unit 110 of the PLC 10 and the reference mark 600 are the first. 1 The difference is that the second storage unit 120A from which the second storage area 1206 for storing the captured image 1406 is excluded is provided.

また、基準マーク600ではなく検査対象50に関する第2基準画像1107と第2撮像画像1407を用いた画像検査前処理をするために、実施の形態1に対して、第1記憶部110Aに記憶されている制御プログラム1101A、輝度閾値1103A及び第1輪郭閾値1104A、第2記憶部120Aの第1格納領域1203A、制御部130の第1判定部1302A、輪郭取得部1303A及び第2判定部1304Aも異なっている。制御プログラム1101A、輝度閾値1103A、第1輪郭閾値1104A、第1格納領域1203A、第1判定部1302A、輪郭取得部1303A及び第2判定部1304Aについて、以下に詳細説明する。 Further, in order to perform image inspection preprocessing using the second reference image 1107 and the second captured image 1407 relating to the inspection target 50 instead of the reference mark 600, the image is stored in the first storage unit 110A with respect to the first embodiment. The control programs 1101A, the brightness threshold 1103A and the first contour threshold 1104A, the first storage area 1203A of the second storage unit 120A, the first determination unit 1302A of the control unit 130, the contour acquisition unit 1303A and the second determination unit 1304A are also different. ing. The control program 1101A, the brightness threshold value 1103A, the first contour threshold value 1104A, the first storage area 1203A, the first determination unit 1302A, the contour acquisition unit 1303A, and the second determination unit 1304A will be described in detail below.

制御プログラム1101Aは、照明部20、カメラ40、モータ80及び表示装置90等の外部機器を制御し、また、基準マーク600の第1撮像画像1406に代えて、カメラ40で撮像された検査対象50の第2撮像画像1407を用いた画像検査前処理及び検査対象50の第2撮像画像1407を用いた画像検査処理を実行するプログラムである。 The control program 1101A controls external devices such as the lighting unit 20, the camera 40, the motor 80, and the display device 90, and replaces the first captured image 1406 of the reference mark 600 with the inspection target 50 imaged by the camera 40. This is a program that executes an image inspection preprocessing using the second captured image 1407 and an image inspection process using the second captured image 1407 of the inspection target 50.

輝度閾値1103Aは、基準マーク600に代えて、輝度センサ30で検出された検査対象50の表面の輝度又はカメラ40で撮像された検査対象50の第2撮像画像1407から算出された輝度(以下、本実施形態では、輝度センサ30が検出した輝度又はカメラ40で撮像された検査対象50の第2撮像画像1407から算出された輝度を検出輝度Anともいう)が、画像検査処理を行うために必要な輝度閾値1103Aの範囲内か否か判断するための閾値である。 The brightness threshold 1103A is the brightness of the surface of the inspection target 50 detected by the brightness sensor 30 or the brightness calculated from the second captured image 1407 of the inspection target 50 imaged by the camera 40 (hereinafter,, instead of the reference mark 600). In the present embodiment, the luminance detected by the luminance sensor 30 or the luminance calculated from the second captured image 1407 of the inspection target 50 imaged by the camera 40 is also referred to as the detection luminance An) is required for performing the image inspection process. It is a threshold value for determining whether or not it is within the range of the brightness threshold value 1103A.

第1輪郭閾値1104Aは、基準マーク600に代えて、検査対象50を撮像して得られた第2撮像画像1407から取得された第2エッジ強度が、検査対象50に関する第2基準画像1107の第1輪郭線と第2撮像画像1407の第2輪郭線とを用いての画像検査処理を行うために必要な強度を有しているか否か判定するための閾値TH1である。 In the first contour threshold value 1104A, instead of the reference mark 600, the second edge intensity obtained from the second captured image 1407 obtained by imaging the inspection target 50 is the second reference image 1107 regarding the inspection target 50. It is a threshold value TH1 for determining whether or not the image inspection process using the 1 contour line and the second contour line of the second captured image 1407 has the intensity required for performing the image inspection process.

第1格納領域1203Aは、基準マーク600に代えて、輝度センサ30等で検出された検査対象50の検出輝度Anが格納される記憶領域である。 The first storage area 1203A is a storage area in which the detection brightness An of the inspection target 50 detected by the brightness sensor 30 or the like is stored instead of the reference mark 600.

第1判定部1302Aは、基準マーク600に代えて、輝度センサ30等で検出された検出輝度Anが輝度閾値1103Aの範囲内か否かを判定する。 The first determination unit 1302A determines whether or not the detection brightness An detected by the brightness sensor 30 or the like is within the range of the brightness threshold value 1103A instead of the reference mark 600.

輪郭取得部1303Aは、基準マーク600に関する画像を除き、検査対象50に関する第2基準画像1107の第1輪郭線、第2撮像画像1407の第2エッジ強度及び第2輪郭線を取得する。 The contour acquisition unit 1303A acquires the first contour line of the second reference image 1107, the second edge strength of the second captured image 1407, and the second contour line of the inspection target 50, excluding the image related to the reference mark 600.

第2判定部1304Aは、基準マーク600に関する輪郭線を除き、輪郭取得部1303によって取得された検査対象50に関する第2撮像画像1407の第2エッジ強度と第1輪郭閾値1104とを用いて、検査対象50に関する第2基準画像1107の第1輪郭線及び第2撮像画像1407の第2輪郭線から検査対象50の検査が実行可能か否かを判定する。 The second determination unit 1304A inspects using the second edge intensity of the second captured image 1407 and the first contour threshold value 1104 regarding the inspection target 50 acquired by the contour acquisition unit 1303, excluding the contour line related to the reference mark 600. From the first contour line of the second reference image 1107 and the second contour line of the second captured image 1407 regarding the target 50, it is determined whether or not the inspection of the inspection target 50 can be performed.

次に、本発明の実施の形態2の検査システムの検査処理について実施の形態1と異なる点を図18を参照しながら説明する。 Next, the inspection process of the inspection system of the second embodiment of the present invention will be described with reference to FIG. 18 at different points from the first embodiment.

PLC10の入力取得部1301は、ステップS2A(輝度検出ステップ)にて、輝度センサ30等で検出された検査対象50の検出輝度Anを取得し、第2記憶部120Aの第1格納領域1203Aに格納し、ステップS3A(撮像ステップ)にて、コンベア70によって移動している検査対象50の表面を撮像して得られた撮像画像である第2撮像画像1407を取得し、第2記憶部120Aの第3格納領域1207に格納する。 The input acquisition unit 1301 of the PLC 10 acquires the detection brightness An of the inspection target 50 detected by the brightness sensor 30 or the like in step S2A (luminance detection step) and stores it in the first storage area 1203A of the second storage unit 120A. Then, in step S3A (imaging step), a second captured image 1407, which is an captured image obtained by imaging the surface of the inspection target 50 moving by the conveyor 70, is acquired, and the second storage unit 120A has a second position. 3 Store in the storage area 1207.

なお、初回の候補ゲインGxの算出時までは、輝度センサ30によって検出された検出輝度Anを用いるが、基準マーク600に代わり、検査対象50の表面からの検出輝度Anが用いられる。2回目以降の候補ゲインGxの算出時には、基準マーク600の第1撮像画像1406に代わり、検査対象50の第2撮像画像1407から算出された検出輝度Anが用いられる。検査対象50の検出輝度Anの検出範囲としては、輝度センサ30によって検査対象50の表面全体の輝度を検出し、カメラ40で検出した検出輝度Anは、カメラ40によって撮像された検査対象50の第2撮像画像1407の全画素から算出された検出輝度を用いる。なお、第2撮像画像1407から算出した検出輝度Anは、第2撮像画像1407中の対象画素のRGB濃度値から前述の式(4)により算出される。第2撮像画像1407中に対象画素が複数ある場合は、複数の対象画素について前述の式(4)により算出して得た値を平均化して算出する。 The detection brightness An detected by the brightness sensor 30 is used until the first calculation of the candidate gain Gx, but the detection brightness An from the surface of the inspection target 50 is used instead of the reference mark 600. When calculating the candidate gain Gx from the second time onward, the detection luminance An calculated from the second captured image 1407 of the inspection target 50 is used instead of the first captured image 1406 of the reference mark 600. As the detection range of the detection brightness An of the inspection target 50, the brightness sensor 30 detects the brightness of the entire surface of the inspection target 50, and the detection brightness An detected by the camera 40 is the first of the inspection targets 50 imaged by the camera 40. 2 The detection brightness calculated from all the pixels of the captured image 1407 is used. The detection luminance An calculated from the second captured image 1407 is calculated by the above equation (4) from the RGB density value of the target pixel in the second captured image 1407. When there are a plurality of target pixels in the second captured image 1407, the values calculated by the above equation (4) for the plurality of target pixels are averaged and calculated.

次に、ステップS4Aでは、PLC10の第1判定部1302Aと第2判定部1304Aは、輝度閾値1103Aと、第2輪郭閾値1105と、第2基準画像1107と、を第1記憶部110Aから読み出し、その後、詳細には後述するが、実施の形態1とは異なる画像検査前処理(ステップS5A)を行う。 Next, in step S4A, the first determination unit 1302A and the second determination unit 1304A of the PLC 10 read the brightness threshold value 1103A, the second contour threshold value 1105, and the second reference image 1107 from the first storage unit 110A. After that, as will be described in detail later, an image inspection preprocessing (step S5A) different from that of the first embodiment is performed.

次に、ステップS5Aの画像検査前処理の詳細について、実施の形態1と異なる点について図19A及び図19Bを参照しながら説明する。 Next, the details of the image inspection preprocessing in step S5A will be described with reference to FIGS. 19A and 19B about the differences from the first embodiment.

まず、ステップS10Aにおいて、第1判定部1302Aは、基準マーク600に代えて、輝度センサ30によって検出された検査対象50の検出輝度Anが輝度閾値1103Aの範囲内にあるか否かを判定する。例えば、前述の式(1)を満たすか否かにより判断する。また、既にステップS80にてカメラ40のゲイン設定値Gnの調整がされている場合には、基準マーク600に代えて、検査対象50の第2撮像画像1407から算出された検出輝度Anが用いられる。なお、本実施の形態の場合では、基準マーク600を使用した実施の形態1とは異なり、基準マーク600の色及び模様を予め設定できないため、検査対象50の色及び模様等に合わせて輝度閾値1103Aはユーザによって予め調整される。 First, in step S10A, the first determination unit 1302A determines whether or not the detected luminance An of the inspection target 50 detected by the luminance sensor 30 is within the range of the luminance threshold 1103A instead of the reference mark 600. For example, it is determined by whether or not the above-mentioned equation (1) is satisfied. If the gain set value Gn of the camera 40 has already been adjusted in step S80, the detection luminance An calculated from the second captured image 1407 of the inspection target 50 is used instead of the reference mark 600. .. In the case of this embodiment, unlike the first embodiment in which the reference mark 600 is used, the color and pattern of the reference mark 600 cannot be set in advance, so that the brightness threshold value is matched to the color and pattern of the inspection target 50. 1103A is pre-adjusted by the user.

そして、ステップS10Aにて検出輝度Anが輝度閾値1103Aの範囲内か否かの判定された後、本実施の形態においても実施の形態1と同様にステップS20からステップS80が実行される。 Then, after it is determined in step S10A whether or not the detected luminance An is within the range of the luminance threshold 1103A, in this embodiment as well, steps S20 to S80 are executed as in the first embodiment.

次に、ステップS90Aでは、輪郭取得部1303Aは、検査対象50の第2基準画像1107から第2基準画像1107の第1エッジ強度を取得し、第1エッジ強度から第1輪郭閾値1104Aを算出し、第1記憶部110Aに第1輪郭閾値1104Aを記憶する。なお、第2基準画像1107から第1輪郭線の第1エッジ強度を取得する位置は、例えば、図14(a)のC−C線で示すように、輪郭線を取得しやすい任意の位置が予め設定される。第2基準画像1107の第1エッジ強度の算出方法は、実施の形態1で前述した第2基準画像1107の第1エッジ強度の算出方法と同様であり、また、相対値化された第2基準画像1107の第1エッジ強度から第1輪郭閾値1104Aとしての閾値TH1が設定される。 Next, in step S90A, the contour acquisition unit 1303A acquires the first edge strength of the second reference image 1107 from the second reference image 1107 of the inspection target 50, and calculates the first contour threshold value 1104A from the first edge strength. , The first contour threshold value 1104A is stored in the first storage unit 110A. The position for acquiring the first edge strength of the first contour line from the second reference image 1107 is, for example, an arbitrary position at which the contour line can be easily acquired, as shown by the CC line in FIG. 14A. It is set in advance. The method for calculating the first edge strength of the second reference image 1107 is the same as the method for calculating the first edge strength of the second reference image 1107 described in the first embodiment, and the second reference is a relative value. The threshold TH1 as the first contour threshold 1104A is set from the first edge strength of the image 1107.

ステップS100A(輪郭取得ステップ)では、輪郭取得部1303は、検査対象50の第2撮像画像1407を第2記憶部120Aの第3格納領域1207から読み出し、第2撮像画像1407の第2エッジ強度を算出する。なお、第2撮像画像1407から第2エッジ強度を取得する位置は、例えば、図14(b)に示すように、第2基準画像1107のC−C線に対応する第2撮像画像1407中のD−D線の位置である。 In step S100A (contour acquisition step), the contour acquisition unit 1303 reads the second captured image 1407 of the inspection target 50 from the third storage area 1207 of the second storage unit 120A, and obtains the second edge strength of the second captured image 1407. calculate. The position for acquiring the second edge intensity from the second captured image 1407 is, for example, in the second captured image 1407 corresponding to the CC line of the second reference image 1107, as shown in FIG. 14 (b). The position of the DD line.

ステップS110Aでは、輪郭取得部1303Aによって取得された第2撮像画像1407の第2エッジ強度が第1輪郭閾値1104Aとしての閾値TH1以上か否か第2判定部1304Aが判定する。 In step S110A, the second determination unit 1304A determines whether or not the second edge intensity of the second captured image 1407 acquired by the contour acquisition unit 1303A is equal to or greater than the threshold value TH1 as the first contour threshold value 1104A.

そして、ステップS110Aにて第2撮像画像1407の第2エッジ強度が第1輪郭閾値1104Aとしての閾値TH1以上か否かの判定された後、本実施の形態においても実施の形態1と同様にステップS120からステップS150が実行される。 Then, after it is determined in step S110A whether or not the second edge intensity of the second captured image 1407 is equal to or higher than the threshold value TH1 as the first contour threshold value 1104A, the step is also performed in the present embodiment in the same manner as in the first embodiment. Step S150 is executed from S120.

このように、実施の形態2における検査システムにあっては、輝度検出部としてのカメラ40の撮像した検査対象50の第2撮像画像1407から求めた検出輝度Anが輝度閾値1103Aの範囲内であると第1判定部1302Aが判定した場合、第2基準画像1107中の第1画素値と第2撮像画像1407中の第2画素値とを比較して、対象の検査を実行し、検出輝度Anが輝度閾値1103Aの範囲外であると第1判定部1302Aが判定した場合、輪郭取得部1303によって取得された第2撮像画像1407の第2輪郭線と、第2基準画像1107の第1輪郭線と、が一致するか判定することにより検査対象50の検査を実行する。そのため、検査対象50の表面の輝度が適切な範囲内となる状況下においては、第2基準画像1107中の第1画素値と第2撮像画像1407中の第2画素値とを比較することで対象の詳細な検査を実行でき、検査対象50の表面の輝度が適切な範囲外となる状況下においても検査対象50の輪郭線を取得できる場合には、移動装置の移動速度を遅くすることなく輪郭線を用いた対象の検査を実行できるという効果を奏する。 As described above, in the inspection system according to the second embodiment, the detection brightness An obtained from the second image 1407 of the inspection target 50 imaged by the camera 40 as the brightness detection unit is within the range of the brightness threshold 1103A. When the first determination unit 1302A determines, the first pixel value in the second reference image 1107 and the second pixel value in the second captured image 1407 are compared, the target inspection is executed, and the detection brightness An. When the first determination unit 1302A determines that is out of the range of the luminance threshold 1103A, the second contour line of the second captured image 1407 acquired by the contour acquisition unit 1303 and the first contour line of the second reference image 1107. And, the inspection of the inspection target 50 is executed by determining whether they match. Therefore, under the condition that the brightness of the surface of the inspection target 50 is within an appropriate range, the first pixel value in the second reference image 1107 and the second pixel value in the second captured image 1407 can be compared. If the detailed inspection of the target can be performed and the contour line of the inspection target 50 can be obtained even when the brightness of the surface of the inspection target 50 is out of the appropriate range, the moving speed of the moving device is not slowed down. It has the effect of being able to inspect the target using contour lines.

また、本実施の形態2における検査システムにあっては、基準マーク600を省略し、検査対象50の第2撮像画像1407から求めた検出輝度Anが輝度閾値1103Aの範囲内か否か第1判定部1302Aが判定する。そして、輪郭取得部1303Aは検査対象50の第2撮像画像1407から第2撮像画像1407の第2エッジ強度を取得し、第2判定部1304Aが第2撮像画像1407の第2エッジ強度が第1輪郭閾値1104A以上であるか判定するようにしている。このように、検査対象50自体を用いて輝度判定及び輪郭線の取得可否の判定を行うため、基準マーク600を省略しコストを低減できるという効果を奏する。なお、実施の形態2の場合、基準マーク600を省略することから、適切な照射量で照明部20から光を照射した条件下において検査対象50の印刷が適切な輝度範囲となるような色が設定されており、コントラスト差が大きくとれる色と模様である場合に使用することが好ましい。 Further, in the inspection system according to the second embodiment, the reference mark 600 is omitted, and the first determination as to whether or not the detection brightness An obtained from the second captured image 1407 of the inspection target 50 is within the range of the brightness threshold 1103A. Unit 1302A determines. Then, the contour acquisition unit 1303A acquires the second edge strength of the second captured image 1407 from the second captured image 1407 of the inspection target 50, and the second determination unit 1304A has the second edge strength of the second captured image 1407 as the first. It is determined whether the contour threshold value is 1104A or more. In this way, since the brightness determination and the determination of whether or not the contour line can be acquired are performed using the inspection target 50 itself, the reference mark 600 can be omitted and the cost can be reduced. In the case of the second embodiment, since the reference mark 600 is omitted, the color such that the printing of the inspection target 50 has an appropriate brightness range under the condition of irradiating the light from the illumination unit 20 with an appropriate irradiation amount is obtained. It is preferably used when the color and pattern are set and a large contrast difference can be obtained.

更に、本実施の形態2における検査システムにあっては、輪郭取得部1303Aは検査対象50の第2撮像画像1407から第2撮像画像1407の第2エッジ強度を取得し、第2判定部1304Aが第2撮像画像1407の第2エッジ強度が第1輪郭閾値以上であると判定した場合、第2基準画像1107中の第1輪郭線と第2撮像画像1407中の第2輪郭線とが一致するか判定することにより検査対象50の検査を実行し、第2判定部1304が第1撮像画像1406の第2エッジ強度が第1輪郭閾値1104A未満であると判定した場合、第2撮像画像1407が取得された時と比較して、第1調整部1305はカメラ40の露光時間設定値ETnが長くなるように調整し、第2調整部1306は検査対象50を移動させる際の移動速度が遅くなるようにモータ80の回転速度設定値Vnを調整する。そのため、検査対象50の輝度が適切な範囲外となった状況下においても検査対象50の輪郭線を取得できる場合には輪郭線を用いた検査対象50の検査を実行でき、検査対象50の輪郭線を取得できない場合に、カメラ40の露光時間設定値ETnが長くなるように、検査対象50の移動速度が遅くなるように調整して、輪郭線を取得できる撮像環境に近づけることができるという効果を奏する。 Further, in the inspection system according to the second embodiment, the contour acquisition unit 1303A acquires the second edge strength of the second image 1407 from the second image 1407 of the inspection target 50, and the second determination unit 1304A When it is determined that the second edge intensity of the second captured image 1407 is equal to or higher than the first contour threshold, the first contour line in the second reference image 1107 and the second contour line in the second captured image 1407 match. When the inspection of the inspection target 50 is executed and the second determination unit 1304 determines that the second edge intensity of the first captured image 1406 is less than the first contour threshold value 1104A, the second captured image 1407 is determined. The first adjusting unit 1305 adjusts the exposure time set value ETn of the camera 40 to be longer than that at the time of acquisition, and the second adjusting unit 1306 slows down the moving speed when moving the inspection target 50. The rotation speed set value Vn of the motor 80 is adjusted so as to. Therefore, if the contour line of the inspection target 50 can be obtained even when the brightness of the inspection target 50 is out of the appropriate range, the inspection of the inspection target 50 using the contour line can be executed, and the contour of the inspection target 50 can be executed. When the line cannot be acquired, the effect is that the moving speed of the inspection target 50 can be adjusted to be slow so that the exposure time set value ETn of the camera 40 becomes long, and the image can be brought closer to an imaging environment in which the contour line can be acquired. Play.

実施の形態3.
続いて、本発明の実施の形態3における検査システムについて図20から図21を用いて説明する。実施の形態3は、図6Bに示す実施の形態1の画像検査前処理の後半処理、又は、図19Bに示す実施の形態2の画像検査前処理の後半処理を変形した実施形態である。なお、実施の形態1及び実施の形態2と異なる構成及びステップの番号にはBを付している。実施の形態1及び実施の形態2と同じ構成については、同一の符号を付し、詳細な説明は省略する。
Embodiment 3.
Subsequently, the inspection system according to the third embodiment of the present invention will be described with reference to FIGS. 20 to 21. The third embodiment is a modification of the second half processing of the image inspection preprocessing of the first embodiment shown in FIG. 6B or the second half processing of the image inspection preprocessing of the second embodiment shown in FIG. 19B. B is added to the configuration and step numbers different from those of the first embodiment and the second embodiment. The same configurations as those of the first embodiment and the second embodiment are designated by the same reference numerals, and detailed description thereof will be omitted.

本発明の実施の形態3における検査システムにおいては、実施の形態1又は実施の形態2に対して、ステップS90BからステップS120Bで第2画像検査処理を行う点が異なる。 The inspection system according to the third embodiment of the present invention is different from the first embodiment or the second embodiment in that the second image inspection process is performed in steps S90B to S120B.

ステップS90Bでは、図13のステップS400と同様に、輪郭取得部1303Aは、検査対象50の第2基準画像1107の全画素を走査して第2基準画像1107の第1輪郭線を取得することで、図15(a)に示す第2基準画像1107中の第1輪郭線が取得される。なお、この第2基準画像1107中の第1輪郭線の取得は、繰り返し実行する必要は無いため、最初の一回だけ実行し第1記憶部110Aに記憶し、2回目以降はステップS90Bをスキップしてもよい。また、この第2基準画像1107中の第1輪郭線の取得は、ステップS90Bではなく、ステップS90Bよりも前のタイミングであればいつ行ってもよい。 In step S90B, similarly to step S400 of FIG. 13, the contour acquisition unit 1303A scans all the pixels of the second reference image 1107 of the inspection target 50 to acquire the first contour line of the second reference image 1107. , The first contour line in the second reference image 1107 shown in FIG. 15A is acquired. Since it is not necessary to repeatedly execute the acquisition of the first contour line in the second reference image 1107, it is executed only once for the first time, stored in the first storage unit 110A, and skips step S90B for the second and subsequent times. You may. Further, the acquisition of the first contour line in the second reference image 1107 may be performed at any time before step S90B instead of step S90B.

次に、ステップS100B(輪郭取得ステップ)では、図13のステップS410とステップS420と同様に、輪郭取得部1303Aは、第2記憶部120Aの第3格納領域1207から第2撮像画像1407を読み出し、検査対象50の第2撮像画像1407の全画素を走査して第2撮像画像1407の第2輪郭線を取得することで、例えば、図15(b)に示す第2撮像画像1407の第2輪郭線を取得する。 Next, in step S100B (contour acquisition step), the contour acquisition unit 1303A reads out the second captured image 1407 from the third storage area 1207 of the second storage unit 120A, as in steps S410 and S420 of FIG. By scanning all the pixels of the second captured image 1407 of the inspection target 50 to acquire the second contour line of the second captured image 1407, for example, the second contour of the second captured image 1407 shown in FIG. 15B is obtained. Get the line.

次に、ステップS110B(第2画像検査ステップ、輪郭判定ステップ)では、図13のステップS430と同様に、ステップS100Bで取得した第2撮像画像1407の第2輪郭線とステップS90Bで取得した第2基準画像1107の第1輪郭線とを第2判定部1304Aは比較し、第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致するか否かを判定する。具体的には、第2撮像画像1407の第2輪郭線と第2基準画像1107の第1輪郭線とを各画素毎に座標上で一致するか判断し、全画素に対する一致度(一致率)が第2輪郭閾値以上か否かを判定する。 Next, in step S110B (second image inspection step, contour determination step), the second contour line of the second captured image 1407 acquired in step S100B and the second contour line acquired in step S90B are the same as in step S430 of FIG. The second determination unit 1304A compares the first contour line of the reference image 1107 with the first contour line of the second captured image 1407, and determines whether or not the second contour line of the second captured image 1407 matches the first contour line of the second reference image 1107. Specifically, it is determined whether the second contour line of the second captured image 1407 and the first contour line of the second reference image 1107 match on the coordinates for each pixel, and the degree of matching (matching rate) for all pixels. Determines if is greater than or equal to the second contour threshold.

第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致する場合(ステップS110B:YES)には、ステップS120Bに進み、検査対象50は良品であると判定され、良品であることを示す第2画像処理結果フラグF4を設定する。第2撮像画像1407の第2輪郭線が第2基準画像1107の第1輪郭線に一致しない場合(ステップS110B:NO)には、ステップS130からステップS160の処理を実施の形態1及び実施の形態2と同様に行う。 When the second contour line of the second captured image 1407 matches the first contour line of the second reference image 1107 (step S110B: YES), the process proceeds to step S120B, and the inspection target 50 is determined to be a good product. The second image processing result flag F4 indicating that the product is non-defective is set. When the second contour line of the second captured image 1407 does not match the first contour line of the second reference image 1107 (step S110B: NO), the processes of steps S130 to S160 are performed in the first and first embodiments. Do the same as in 2.

そして、図21に示すように、ステップS220Bにて、第2画像処理結果フラグF4が設定されているか否かを第2判定部1304は確認する。第2画像処理結果フラグF4が設定されていると判定された場合(ステップS220B:YES)、ステップS230Bへ進み、検査対象50は良品であると判定し、画像検査処理を終了する。ステップS220Bで、第2画像処理結果フラグF4が設定されていないと判定された場合(ステップS220B:NO)、ステップS240以降の処理を実施の形態1及び実施の形態2と同様に行う。 Then, as shown in FIG. 21, in step S220B, the second determination unit 1304 confirms whether or not the second image processing result flag F4 is set. When it is determined that the second image processing result flag F4 is set (step S220B: YES), the process proceeds to step S230B, it is determined that the inspection target 50 is a non-defective product, and the image inspection process is terminated. When it is determined in step S220B that the second image processing result flag F4 is not set (step S220B: NO), the processing after step S240 is performed in the same manner as in the first and second embodiments.

このような実施の形態3における検査システムにあっても、実施の形態1及び実施の形態2と同様に、検査対象50の輝度が適切な範囲外となった状況下においても検査対象50の輪郭線を取得できる場合には輪郭線を用いた検査対象50の検査を実行でき、検査対象50の輪郭線を取得できない場合に、カメラ40の露光時間設定値ETnが長くなるように、検査対象50の移動速度が遅くなるように調整して、輪郭線を取得できる撮像環境に近づけることができるという効果を奏する。 Even in the inspection system according to the third embodiment, the contour of the inspection target 50 is contoured even when the brightness of the inspection target 50 is out of the appropriate range, as in the first and second embodiments. If the line can be acquired, the inspection target 50 can be inspected using the contour line, and if the contour line of the inspection target 50 cannot be acquired, the inspection target 50 is set so that the exposure time set value ETn of the camera 40 becomes long. By adjusting the moving speed of the camera to be slower, it is possible to bring the image closer to an imaging environment where contour lines can be obtained.

変形例.
上述の実施の形態1から実施の形態3においては、輝度センサ30で輝度の検出をするとともに、カメラ40で撮像された基準マーク600の第1撮像画像1406又は検査対象50の第2撮像画像1407の輝度を検出し、それぞれを用いて検出輝度が輝度閾値1103,1103Aの範囲内に収まるか否か判定しているが、カメラ40で撮像された基準マーク600の第1撮像画像1406又は検査対象50の第2撮像画像1407の検出輝度のみを用いて輝度判定を行うようにしてもよい。この場合、輝度センサ30を省略できる。
Modification example.
In the above-described first to third embodiments, the luminance sensor 30 detects the luminance, and the first captured image 1406 of the reference mark 600 or the second captured image 1407 of the inspection target 50 captured by the camera 40. The brightness of the reference mark 600 is detected and it is determined whether or not the detected brightness falls within the range of the brightness thresholds 1103 and 1103A, but the first captured image 1406 of the reference mark 600 captured by the camera 40 or the inspection target. The brightness determination may be performed using only the detection brightness of the 50th second captured image 1407. In this case, the brightness sensor 30 can be omitted.

また、実施の形態1から実施の形態3においては、輝度センサ30によって検出した検出輝度Anが基準マーク600又は検査対象50の表面全体からの検出輝度であり、カメラ40によって検出した検出輝度Anが基準マーク600の第1撮像画像1406又は検査対象50の第2撮像画像1407の全画素から算出された検出輝度を用いたが、検出輝度はこれに限定されない。輝度センサ30によって基準マーク600の表面のうちの特定位置の輝度を検出してもよく、この場合には、カメラ40で検出した検出輝度Anは、カメラ40によって撮像された基準マーク600の第1撮像画像1406中の全画素のうち特定位置に対応する画素から算出された検出輝度を用いてもよい。また、輝度センサ30によって検査対象50の表面のうちの特定位置の輝度を検出してもよく、この場合には、カメラ40で検出した検出輝度Anは、カメラ40によって撮像された検査対象50の第2撮像画像1407中の全画素のうち特定位置に対応する画素から算出された検出輝度を用いてもよい。 Further, in the first to third embodiments, the detection brightness An detected by the brightness sensor 30 is the detection brightness from the entire surface of the reference mark 600 or the inspection target 50, and the detection brightness An detected by the camera 40 is Although the detection luminance calculated from all the pixels of the first captured image 1406 of the reference mark 600 or the second captured image 1407 of the inspection target 50 is used, the detection luminance is not limited to this. The brightness sensor 30 may detect the brightness at a specific position on the surface of the reference mark 600. In this case, the detection brightness An detected by the camera 40 is the first of the reference mark 600 imaged by the camera 40. The detection brightness calculated from the pixels corresponding to the specific position among all the pixels in the captured image 1406 may be used. Further, the brightness sensor 30 may detect the brightness at a specific position on the surface of the inspection target 50. In this case, the detection brightness An detected by the camera 40 is the inspection target 50 imaged by the camera 40. The detection luminance calculated from the pixels corresponding to the specific position among all the pixels in the second captured image 1407 may be used.

また、実施の形態1から実施の形態3においては、第1輪郭閾値1104,1104Aは、第1記憶部110,110Aに記憶された第1基準画像1106、第2基準画像1107から画像検査前処理にて算出されるようにしたが、第1基準画像1106、第2基準画像1107から算出したものを予め記憶するようにしてもよい。また、第1基準画像1106、第2基準画像1107のエッジ強度を絶対値化して第1輪郭閾値1104,1104Aを求めたが、これに限らず、エッジ強度を絶対値化せずに、正の閾値と負の閾値の両方を持たせ、正の閾値を正方向に超える、又は、負の閾値を負方向に超える場合を第1輪郭閾値以上と判定するようにしてもよい。この場合、正の閾値を正方向に超える、又は、負の閾値を負方向に超えるという判定条件は、本発明の「第1輪郭閾値以上」に含まれる。 Further, in the first to third embodiments, the first contour thresholds 1104 and 1104A are preprocessed from the first reference image 1106 and the second reference image 1107 stored in the first storage units 110 and 110A. However, the one calculated from the first reference image 1106 and the second reference image 1107 may be stored in advance. Further, the edge strengths of the first reference image 1106 and the second reference image 1107 are converted into absolute values to obtain the first contour threshold values 1104 and 1104A, but the present invention is not limited to this, and the edge strengths are not converted into absolute values and are positive. Both a threshold value and a negative threshold value may be provided, and a case where the positive threshold value is exceeded in the positive direction or the negative threshold value is exceeded in the negative direction may be determined as the first contour threshold value or higher. In this case, the determination condition that the positive threshold value is exceeded in the positive direction or the negative threshold value is exceeded in the negative direction is included in the "first contour threshold value or higher" of the present invention.

また、実施の形態1から実施の形態3においては、エッジ強度の算出方法として、輝度を微分することを例示したが、キャニー法、キャニー・デリチェ法、ソーベル法、ラプラシアン法等の公知の他の方法を用いてもよい。 Further, in the first to third embodiments, differentiating the luminance is exemplified as the method for calculating the edge strength, but other known methods such as the Canny method, the Canny Delice method, the Sobel method, and the Laplacian method are used. The method may be used.

また、実施の形態1から実施の形態3においては、第1画像検査処理をRGB濃度値又はHSV色空間の色相H、彩度S及び明度Vに基づいて行っているが、色情報はこれらに限らず、HSL色空間又はCMYK等の他の色モデルに基づいて行ってもよい。 Further, in the first to third embodiments, the first image inspection process is performed based on the RGB density value or the hue H, saturation S, and lightness V of the HSV color space, but the color information is based on these. Not limited to this, it may be performed based on the HSL color space or another color model such as CMYK.

また、実施の形態1から実施の形態3においては、第1画像検査処理をRGB濃度値の3つの濃度値又はHSV色空間の色相H、彩度S及び明度Vの3つの色に関する特徴量に基づいて行っているが、RGB濃度値の3つの濃度値の少なくとも1つ、又は、色相H、彩度S及び明度Vの少なくとも1つの色情報を原画像の画素値として採用し、第1画像検査処理を行ってもよい。なお、第1画像検査処理に用いる画素値は、輪郭線を画像から抽出する前の多値を取りえる多階調の画素値であり、濃度値又は濃淡値等も含まれる。 Further, in the first to third embodiments, the first image inspection process is performed on the three density values of the RGB density values or the feature quantities relating to the three colors of hue H, saturation S, and lightness V in the HSV color space. Although this is done based on the above, at least one of the three RGB density values or at least one color information of hue H, saturation S, and lightness V is adopted as the pixel value of the original image, and the first image The inspection process may be performed. The pixel value used in the first image inspection process is a multi-gradation pixel value that can take a multi-value before extracting the contour line from the image, and includes a density value, a shading value, and the like.

また、実施の形態1から実施の形態3においては、検出輝度Anが輝度閾値1103,1103Aの範囲内であると判定した場合には、基準画像中の画素の画素値である第1画素値としての第1色情報と撮像画像中の画素の画素値である第2画素値としての第2色情報を用いる色成分抽出法を取り入れた良品判定処理を第1画像検査処理に用いているが、これに限らず、公知の他のパターンマッチング法、テンプレートマッチング法等を用いてもよい。 Further, in the first to third embodiments, when it is determined that the detected brightness An is within the range of the brightness thresholds 1103 and 1103A, it is set as the first pixel value which is the pixel value of the pixel in the reference image. The non-defective product judgment process incorporating the color component extraction method using the first color information and the second color information as the second pixel value, which is the pixel value of the pixel in the captured image, is used for the first image inspection process. Not limited to this, other known pattern matching methods, template matching methods and the like may be used.

また、実施の形態1から実施の形態3においては、第2撮像画像1407の第2輪郭線と第2基準画像1107の第1輪郭線とを画素毎に座標値が一致するか比較し、全画素に対する一致率が第2輪郭閾値以上か否かを判定したが、これに限らず、第2撮像画像1407の第2輪郭線から第2基準画像1107の第1輪郭線を差し引いた差分画像を更に生成し、差分画像に残った輪郭線の画素数が第2輪郭閾値未満である場合に、第2撮像画像1407の第2輪郭線と第2基準画像1107の第1輪郭線とが一致すると判定しても良い。 Further, in the first to third embodiments, the second contour line of the second captured image 1407 and the first contour line of the second reference image 1107 are compared for each pixel to see if the coordinate values match, and all of them are compared. It was determined whether or not the matching rate with respect to the pixels was equal to or higher than the second contour threshold, but the difference is not limited to this, and a difference image obtained by subtracting the first contour line of the second reference image 1107 from the second contour line of the second captured image 1407 is obtained. Further, when the number of pixels of the contour line generated and remaining in the difference image is less than the second contour threshold value, the second contour line of the second captured image 1407 and the first contour line of the second reference image 1107 match. You may judge.

また、実施の形態1から実施の形態3においては、第1記憶部110,110Aと、第2記憶部120,120Aとを分けたが、1つの記憶装置の中で格納領域が分かれているものであってもよい。 Further, in the first to third embodiments, the first storage units 110 and 110A and the second storage units 120 and 120A are separated, but the storage area is divided in one storage device. It may be.

また、実施の形態1においては、基準マーク600をトレー60に設けたが、これに限らず、検査対象50の表面に基準マーク600のシール又は印刷を施してもよい。この場合、トレー60を省略し、検査対象50をコンベア70に直接載せてもよい。 Further, in the first embodiment, the reference mark 600 is provided on the tray 60, but the present invention is not limited to this, and the reference mark 600 may be sealed or printed on the surface of the inspection target 50. In this case, the tray 60 may be omitted and the inspection target 50 may be placed directly on the conveyor 70.

また、実施の形態2においては、基準マーク600を省略したが、この場合もトレー60を省略し、検査対象50をコンベア70に直接載せてもよい。 Further, in the second embodiment, the reference mark 600 is omitted, but in this case as well, the tray 60 may be omitted and the inspection target 50 may be placed directly on the conveyor 70.

本発明は、広義の精神と範囲を逸脱することなく、様々な実施形態及び変形が可能とされるものである。また、上述した実施形態は、本発明を説明するためのものであり、本発明の範囲を限定するものではない。つまり、本発明の範囲は、実施形態ではなく、請求の範囲によって示される。そして、請求の範囲内及びそれと同等の発明の意義の範囲内で施される様々な変形が、本発明の範囲内とみなされる。 The present invention allows for various embodiments and modifications without departing from the broad spirit and scope. Moreover, the above-described embodiment is for explaining the present invention, and does not limit the scope of the present invention. That is, the scope of the present invention is indicated not by the embodiment but by the claims. Then, various modifications made within the scope of the claims and the equivalent meaning of the invention are considered to be within the scope of the present invention.

10 PLC、20 照明部、 30 輝度センサ、40 カメラ、50 検査対象、60トレー、70 コンベア、80 モータ、90 表示装置、110,110A 第1記憶部、120,120A 第2記憶部、130 制御部、140 通信I/F部、150 通信バス、501,1108,1408 商品名等の文字、502,1109,1409 背景模様、503,1110,1410 賞味期限の文字、600 基準マーク、1101,1101A 制御プログラム、1102 初期設定値、1103,1103A 輝度閾値、1104,1104A 第1輪郭閾値、1105 第2輪郭閾値、1106 第1基準画像、1107 第2基準画像、1203,1203A 第1格納領域、1206 第2格納領域、1207 第3格納領域、1300 初期設定部、1301 入力取得部、1302,1302A 第1判定部、1303,1303A 輪郭取得部、1304,1304A 第2判定部、1305 第1調整部、1306 第2調整部、1307 第3調整部、1308 第4調整部、1406 第1撮像画像、1407 第2撮像画像、1411 汚れ 10 PLC, 20 lighting unit, 30 brightness sensor, 40 camera, 50 inspection target, 60 tray, 70 conveyor, 80 motor, 90 display device, 110, 110A 1st storage unit, 120, 120A 2nd storage unit, 130 control unit , 140 communication I / F section, 150 communication bus, characters such as 501,1108,1408 product name, 502,1109,1409 background pattern, 503,1110,1410 expiration date characters, 600 reference mark, 1101,1101A control program , 1102 initial setting value, 1103, 1103A brightness threshold, 1104, 1104A first contour threshold, 1105 second contour threshold, 1106 first reference image, 1107 second reference image, 1203, 1203A first storage area, 1206 second storage Area, 1207 3rd storage area, 1300 initial setting unit, 1301 input acquisition unit, 1302, 1302A first judgment unit, 1303, 1303A contour acquisition unit, 1304, 1304A second judgment unit, 1305 first adjustment unit, 1306 second Adjustment unit, 1307 3rd adjustment unit, 1308 4th adjustment unit, 1406 1st captured image, 1407 2nd captured image, 1411 Dirt

第2の発明に係る検査方法は、i)光が照射された対象の表面の輝度を検出する輝度検出ステップと、ii)対象を撮像し、対象の撮像画像を取得する撮像ステップと、iii)輝度検出ステップで検出された検出輝度が、輝度閾値の範囲内か否かを判定する輝度判定ステップと、iv)輝度判定ステップにおいて、検出輝度が輝度閾値の範囲内であると判定された場合に、撮像画像と比較するための基準となる基準画像中の画素の画素値である第1画素値と撮像画像中の画素の画素値である第2画素値とを比較して、対象の検査を実行する第1画像検査ステップと、v)撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得ステップと、vi)輝度判定ステップにおいて、検出輝度が輝度閾値の範囲外であると判定された場合に、輪郭取得ステップにおいて取得された撮像画像の第2輪郭線と、基準画像中の輪郭線である第1輪郭線と、が一致するか判定する第2画像検査ステップと、を備えるものである。 The inspection method according to the second invention includes i) a brightness detection step of detecting the brightness of the surface of the object irradiated with light, ii) an imaging step of imaging the object and acquiring an captured image of the object, and iii). When it is determined in the luminance determination step for determining whether or not the detected luminance detected in the luminance detection step is within the luminance threshold range and in the iv) luminance determination step that the detected luminance is within the luminance threshold range. , The target inspection is performed by comparing the first pixel value, which is the pixel value of the pixel in the reference image, which is the reference for comparison with the captured image, and the second pixel value, which is the pixel value of the pixel in the captured image. In the first image inspection step to be executed, v) the contour acquisition step for acquiring the second contour line which is the contour line in the captured image, and vi) the brightness determination step, it is determined that the detected luminance is out of the range of the luminance threshold. When this is done, a second image inspection step of determining whether or not the second contour line of the captured image acquired in the contour acquisition step and the first contour line which is the contour line in the reference image match is provided. It is a thing.

第1及び第2の発明の検査装置及び検査方法は、検出輝度が輝度閾値の範囲内であると判定された場合に、撮像画像と比較するための基準となる基準画像の第1画素値と撮像画像の第2画素値とを比較して、対象の検査を実行し、対象の検出輝度が輝度閾値外である場合に、基準画像の第1輪郭線と撮像画像の第1輪郭線とが一致するか判定することにより対象の検査を実行するようにしたため、対象の輝度が適切な範囲外となった状況下においても対象の輪郭線を取得できる場合には輪郭線を用いた対象の検査を実行できるという効果を有する。The inspection apparatus and inspection method of the first and second inventions are used with the first pixel value of the reference image as a reference for comparison with the captured image when the detection brightness is determined to be within the range of the luminance threshold value. When the target is inspected by comparing with the second pixel value of the captured image and the detected brightness of the target is outside the luminance threshold, the first contour line of the reference image and the first contour line of the captured image are aligned. Since the inspection of the target is performed by determining whether it matches, the inspection of the target using the contour line can be obtained even when the brightness of the target is out of the appropriate range. Has the effect of being able to execute.

Claims (11)

対象の表面の輝度を検出する輝度検出部と、
前記対象を撮像し、前記対象の撮像画像を取得する撮像部と、
前記輝度検出部によって検出された検出輝度が閾値の範囲内か否かを判定するための輝度閾値と、前記撮像部によって取得された前記撮像画像と比較するための基準となる基準画像と、を記憶する記憶部と、
前記輝度検出部によって検出された検出輝度が、前記輝度閾値の範囲内か否かを判定する第1判定部と、
前記撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得部と、
i)前記第1判定部が、前記検出輝度が前記輝度閾値の範囲内であると判定した場合には、前記基準画像中の画素の画素値である第1画素値と前記撮像画像中の画素の画素値である第2画素値とを比較して、前記対象の検査を実行し、ii)前記第1判定部が、前記検出輝度が前記輝度閾値の範囲外であると判定した場合に、前記輪郭取得部によって取得された前記撮像画像の前記第2輪郭線と、前記基準画像中の輪郭線である第1輪郭線と、が一致するか判定することにより前記対象の検査を実行する第2判定部と、
を備える検査装置。
A brightness detector that detects the brightness of the surface of the target,
An imaging unit that images the target and acquires the captured image of the target,
A luminance threshold for determining whether or not the detected luminance detected by the luminance detection unit is within the threshold range, and a reference image as a reference for comparison with the captured image acquired by the imaging unit. A memory unit to memorize and
A first determination unit that determines whether or not the detection brightness detected by the brightness detection unit is within the range of the brightness threshold value, and
A contour acquisition unit that acquires a second contour line that is a contour line in the captured image, and
i) When the first determination unit determines that the detected brightness is within the range of the brightness threshold, the first pixel value which is the pixel value of the pixel in the reference image and the pixel in the captured image. When the inspection of the target is executed by comparing with the second pixel value which is the pixel value of ii), the first determination unit determines that the detected brightness is out of the range of the brightness threshold. The inspection of the target is executed by determining whether the second contour line of the captured image acquired by the contour acquisition unit and the first contour line which is the contour line in the reference image match. 2 Judgment unit and
Inspection device equipped with.
前記第1画素値は、前記第1輪郭線の取得前の前記基準画像中の画素の画素値であり、
前記第2画素値は、前記第2輪郭線の取得前の前記撮像画像中の画素の画素値である、
請求項1に記載の検査装置。
The first pixel value is a pixel value of a pixel in the reference image before acquisition of the first contour line.
The second pixel value is a pixel value of a pixel in the captured image before the acquisition of the second contour line.
The inspection device according to claim 1.
前記第1画素値は、前記基準画像の原画像の画素値であり、
前記第2画素値は、前記撮像画像の原画像の画素値である、
請求項2に記載の検査装置
The first pixel value is a pixel value of the original image of the reference image, and is
The second pixel value is a pixel value of the original image of the captured image.
The inspection device according to claim 2.
前記第1画素値は、前記基準画像の色情報である第1色情報であり、
前記第2画素値は、前記撮像画像の色情報である第2色情報である、
請求項1から請求項3のいずれか一項に記載の検査装置。
The first pixel value is the first color information which is the color information of the reference image.
The second pixel value is the second color information which is the color information of the captured image.
The inspection device according to any one of claims 1 to 3.
前記対象は、基準マークと検査対象とを含み、
前記基準画像は、前記基準マークに関する第1基準画像と、前記検査対象に関する良品画像である第2基準画像と、を含み、
前記対象の前記撮像画像は、前記基準マークの撮像画像である第1撮像画像と、前記検査対象の撮像画像である第2撮像画像と、を含み、
前記基準画像の前記第1輪郭線は、前記第1基準画像の第1輪郭線と、前記第2基準画像の第1輪郭線と、を含み、
前記撮像画像の前記第2輪郭線は、前記第1撮像画像の第2輪郭線と、前記第2撮像画像の第2輪郭線と、を含み、
前記記憶部は、前記第1撮像画像のエッジ強度と比較するための輪郭閾値を更に記憶し、
前記輝度検出部は、前記基準マークの表面の輝度である基準マークの検出輝度を検出し、
前記撮像部は、前記基準マーク及び前記検査対象を撮像し、前記基準マークの前記第1撮像画像及び前記検査対象の前記第2撮像画像を取得し、
前記輪郭取得部は、前記第1撮像画像の前記エッジ強度と、前記第1撮像画像の前記第2輪郭線と、前記第2撮像画像の前記第2輪郭線と、を取得し、
前記第1判定部が前記輝度検出部によって検出された前記基準マークの検出輝度が前記輝度閾値の範囲外であると判定し、前記輪郭取得部によって取得された前記第1撮像画像の前記エッジ強度が前記輪郭閾値以上である場合に、前記第2判定部は、前記第2基準画像の前記第1輪郭線と前記第2撮像画像の前記第2輪郭線とが一致するか判定することにより前記検査対象の検査を実行する、
請求項1から請求項4のいずれか一項に記載の検査装置。
The subject includes a reference mark and an inspection subject.
The reference image includes a first reference image relating to the reference mark and a second reference image which is a good product image relating to the inspection target.
The captured image of the target includes a first captured image which is a captured image of the reference mark and a second captured image which is a captured image of the inspection target.
The first contour line of the reference image includes a first contour line of the first reference image and a first contour line of the second reference image.
The second contour line of the captured image includes a second contour line of the first captured image and a second contour line of the second captured image.
The storage unit further stores the contour threshold value for comparison with the edge intensity of the first captured image.
The brightness detection unit detects the detection brightness of the reference mark, which is the brightness of the surface of the reference mark.
The imaging unit captures the reference mark and the inspection target, acquires the first image of the reference mark and the second image of the inspection target, and obtains the second image.
The contour acquisition unit acquires the edge strength of the first captured image, the second contour line of the first captured image, and the second contour line of the second captured image.
The first determination unit determines that the detection brightness of the reference mark detected by the brightness detection unit is outside the range of the brightness threshold value, and the edge strength of the first captured image acquired by the contour acquisition unit. Is equal to or greater than the contour threshold value, the second determination unit determines whether or not the first contour line of the second reference image and the second contour line of the second captured image match. Perform the inspection of the inspection target,
The inspection device according to any one of claims 1 to 4.
前記撮像部の露光時間を調整する第1調整部と、
前記検査対象と前記基準マークとを移動させる移動装置によって前記検査対象と前記基準マークとを移動させる速度である移動速度を調整する第2調整部と、
を備え、
前記輪郭取得部によって取得された前記第1撮像画像の前記エッジ強度が前記輪郭閾値未満である場合に、前記第1撮像画像が取得された時と比較して、前記第1調整部は、前記露光時間が長くなるように調整し、前記第2調整部は、前記移動速度が遅くなるように調整する、
請求項5に記載の検査装置。
The first adjusting unit for adjusting the exposure time of the imaging unit and
A second adjusting unit that adjusts the moving speed, which is the speed at which the inspection target and the reference mark are moved by the moving device that moves the inspection target and the reference mark.
With
When the edge intensity of the first captured image acquired by the contour acquisition unit is less than the contour threshold value, the first adjusting unit is compared with the case where the first captured image is acquired. The exposure time is adjusted to be long, and the second adjusting unit is adjusted so that the moving speed is slowed down.
The inspection device according to claim 5.
対象を撮像し、前記対象の撮像画像を取得する撮像部と、
前記対象を移動させる移動装置と、
前記撮像部によって取得された前記撮像画像と比較するための基準となる基準画像と、前記撮像画像のエッジ強度と比較するための輪郭閾値と、を記憶する記憶部と、
前記撮像画像の前記エッジ強度と前記撮像画像中の輪郭線である第2輪郭線とを取得する輪郭取得部と、
前記輪郭取得部によって取得された前記撮像画像の前記エッジ強度が前記輪郭閾値以上である場合に、前記基準画像中の輪郭線である第1輪郭線と前記撮像画像中の輪郭線である第2輪郭線とが一致するか判定することにより前記対象の検査を実行する判定部と、
前記輪郭取得部によって取得された前記エッジ強度が前記輪郭閾値未満である場合に、前記撮像画像が取得された時と比較して、前記撮像部の露光時間が長くなるように調整する第1調整部と、
前記輪郭取得部によって取得された前記エッジ強度が前記輪郭閾値未満である場合に、前記撮像画像が取得された時と比較して、前記移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する第2調整部と、
を備える検査システム。
An imaging unit that images an object and acquires the captured image of the object,
A moving device for moving the object and
A storage unit that stores a reference image as a reference for comparison with the captured image acquired by the imaging unit, and a contour threshold value for comparison with the edge strength of the captured image.
A contour acquisition unit that acquires the edge strength of the captured image and the second contour line that is the contour line in the captured image.
When the edge intensity of the captured image acquired by the contour acquisition unit is equal to or greater than the contour threshold value, the first contour line which is the contour line in the reference image and the second contour line which is the contour line in the captured image. A determination unit that executes the inspection of the target by determining whether the contour lines match, and
The first adjustment for adjusting the exposure time of the imaging unit to be longer than when the captured image is acquired when the edge intensity acquired by the contour acquisition unit is less than the contour threshold value. Department and
When the edge strength acquired by the contour acquisition unit is less than the contour threshold value, the moving speed, which is the speed at which the object is moved by the moving device, is slower than when the captured image is acquired. The second adjustment part that adjusts so that
Inspection system equipped with.
対象を撮像し、前記対象の撮像画像を取得する撮像部と、
前記対象を移動させる移動装置と、
前記撮像部によって取得された前記撮像画像と比較するための基準となる基準画像と、を記憶する記憶部と、
前記撮像画像の輪郭線である第2輪郭線を取得する輪郭取得部と、
前記基準画像中の輪郭線である第1輪郭線と前記撮像画像の前記第2輪郭線とが一致する場合に、前記対象は良品であると判定する判定部と、
前記基準画像の前記第1輪郭線と前記撮像画像の前記第2輪郭線とが一致しない場合に、前記撮像画像が取得された時と比較して、前記撮像部の露光時間が長くなるように調整する第1調整部と、
前記基準画像の前記第1輪郭線と前記撮像画像の前記第2輪郭線とが一致しない場合に、前記撮像画像が取得された時と比較して、前記移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する第2調整部と、
を備える検査システム。
An imaging unit that images an object and acquires the captured image of the object,
A moving device for moving the object and
A storage unit that stores a reference image as a reference for comparison with the captured image acquired by the imaging unit, and a storage unit that stores the reference image.
A contour acquisition unit that acquires a second contour line that is the contour line of the captured image, and
When the first contour line which is the contour line in the reference image and the second contour line of the captured image match, the determination unit for determining that the target is a non-defective product and
When the first contour line of the reference image and the second contour line of the captured image do not match, the exposure time of the image pickup unit is longer than when the captured image is acquired. The first adjustment part to adjust and
When the first contour line of the reference image and the second contour line of the captured image do not match, the speed at which the target is moved by the moving device as compared with the time when the captured image is acquired. A second adjustment unit that adjusts a certain movement speed to slow down,
Inspection system equipped with.
光が照射された対象の表面の輝度を検出する輝度検出ステップと、
前記対象を撮像し、前記対象の撮像画像を取得する撮像ステップと、
前記輝度検出ステップで検出された検出輝度が、輝度閾値の範囲内か否かを判定する輝度判定ステップと、
前記輝度判定ステップにおいて、前記検出輝度が前記輝度閾値の範囲内であると判定された場合に、前記撮像画像と比較するための基準となる基準画像中の画素の画素値である第1画素値と前記撮像画像中の画素の画素値である第2画素値とを比較して、前記対象の検査を実行する第1画像検査ステップと、
前記撮像画像中の輪郭線である第2輪郭線を取得する輪郭取得ステップと、
前記輝度判定ステップにおいて、前記検出輝度が前記輝度閾値の範囲外であると判定された場合に、前記輪郭取得ステップにおいて取得された前記撮像画像の前記第2輪郭線と、前記基準画像中の輪郭線である第1輪郭線とが一致するか判定する第2画像検査ステップと、
を備える検査方法。
A brightness detection step that detects the brightness of the surface of the object irradiated with light,
An imaging step of imaging the target and acquiring the captured image of the target,
A luminance determination step for determining whether or not the detected luminance detected in the luminance detection step is within the luminance threshold value, and a luminance determination step.
In the brightness determination step, when it is determined that the detected brightness is within the range of the brightness threshold, the first pixel value which is the pixel value of the pixel in the reference image as a reference for comparison with the captured image. And the second pixel value, which is the pixel value of the pixel in the captured image, are compared with the first image inspection step of executing the inspection of the target.
A contour acquisition step for acquiring a second contour line, which is a contour line in the captured image, and
When it is determined in the brightness determination step that the detected brightness is outside the range of the brightness threshold value, the second contour line of the captured image acquired in the contour acquisition step and the contour in the reference image. The second image inspection step of determining whether or not the first contour line, which is a line, matches, and
Inspection method including.
対象を撮像し、前記対象の撮像画像を取得する撮像ステップと、
前記撮像画像のエッジ強度と前記撮像画像の輪郭線である第2輪郭線とを取得する輪郭取得ステップと、
前記輪郭取得ステップによって取得された前記撮像画像のエッジ強度が、輪郭閾値以上である場合に、前記撮像画像と比較するための基準となる基準画像中の輪郭線である第1輪郭線と前記撮像画像の前記第2輪郭線とが一致するか判定することにより前記対象の検査を実行する輪郭判定ステップと、
前記輪郭取得ステップによって取得された前記エッジ強度が前記輪郭閾値未満である場合に、前記撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整し、移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する調整ステップと、
を備える検査方法。
An imaging step of imaging an object and acquiring the captured image of the object,
A contour acquisition step for acquiring the edge strength of the captured image and the second contour line which is the contour line of the captured image, and
When the edge intensity of the captured image acquired by the contour acquisition step is equal to or greater than the contour threshold value, the first contour line which is the contour line in the reference image as a reference for comparison with the captured image and the imaging A contour determination step of executing the inspection of the target by determining whether or not the second contour line of the image matches.
When the edge intensity acquired by the contour acquisition step is less than the contour threshold value, the exposure time of the imaging unit is adjusted to be longer than when the captured image is acquired, and the moving device is used. An adjustment step that adjusts the movement speed, which is the speed at which the object is moved, and
Inspection method including.
対象を撮像し、前記対象の撮像画像を取得する撮像ステップと、
前記撮像画像の輪郭線である第2輪郭線を取得する輪郭取得ステップと、
前記輪郭取得ステップによって取得された前記撮像画像の前記第2輪郭線と、前記撮像画像と比較するための基準となる基準画像中の輪郭線である第1輪郭線と、が一致する場合に、前記対象は良品であると判定する輪郭判定ステップと、
前記輪郭取得ステップによって取得された前記撮像画像の前記第2輪郭線と、前記基準画像の前記第1輪郭線と、が一致しない場合に、前記撮像画像が取得された時と比較して、撮像部の露光時間が長くなるように調整し、移動装置によって前記対象を移動させる速度である移動速度が遅くなるように調整する調整ステップと、
を備える検査方法。
An imaging step of imaging an object and acquiring the captured image of the object,
The contour acquisition step of acquiring the second contour line, which is the contour line of the captured image, and
When the second contour line of the captured image acquired by the contour acquisition step and the first contour line, which is the contour line in the reference image as a reference for comparison with the captured image, match. The contour determination step for determining that the target is a non-defective product, and
When the second contour line of the captured image acquired by the contour acquisition step and the first contour line of the reference image do not match, the image is captured as compared with the case where the captured image is acquired. An adjustment step that adjusts the exposure time of the part to be longer and adjusts so that the moving speed, which is the speed at which the object is moved by the moving device, becomes slower.
Inspection method including.
JP2019542239A 2018-12-18 2018-12-18 Inspection device and inspection method Expired - Fee Related JP6642776B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/046463 WO2020129140A1 (en) 2018-12-18 2018-12-18 Testing device, testing system and testing method

Publications (2)

Publication Number Publication Date
JP6642776B1 JP6642776B1 (en) 2020-02-12
JPWO2020129140A1 true JPWO2020129140A1 (en) 2021-02-15

Family

ID=69412090

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019542239A Expired - Fee Related JP6642776B1 (en) 2018-12-18 2018-12-18 Inspection device and inspection method

Country Status (2)

Country Link
JP (1) JP6642776B1 (en)
WO (1) WO2020129140A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022114908A (en) * 2021-01-27 2022-08-08 オムロン株式会社 Photographing condition setting system, photographing condition setting method and program
CN116095903B (en) * 2023-02-27 2024-02-23 山东欣立得光电科技有限公司 LED lighting system capable of improving universality

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5321767A (en) * 1992-08-28 1994-06-14 Kabushiki Kaisha Komatsu Seisakusho Method of forming a mask in image processing operation
JPH0761699A (en) * 1993-08-31 1995-03-07 Jieneshisu:Kk Sheet material surface inspecting device
JP3114668B2 (en) * 1997-10-03 2000-12-04 日本電気株式会社 Object detection / background removal method, apparatus, and recording medium recording program
JP2000285224A (en) * 1999-03-30 2000-10-13 Matsushita Electric Ind Co Ltd On-vehicle picture storage device and on-vehicle picture recognition device
JP2002195958A (en) * 2000-12-26 2002-07-10 Yamatake Corp Surface inspecting method
JP2003090778A (en) * 2001-09-20 2003-03-28 Pentax Corp Image-inspecting apparatus
JP5556346B2 (en) * 2010-05-11 2014-07-23 株式会社Sumco Wafer defect inspection apparatus and wafer defect inspection method

Also Published As

Publication number Publication date
JP6642776B1 (en) 2020-02-12
WO2020129140A1 (en) 2020-06-25

Similar Documents

Publication Publication Date Title
US9536295B2 (en) Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and recording device
JP3551188B2 (en) Surface condition inspection method and substrate inspection device
US5379347A (en) Method of inspecting the surface of a workpiece
JP7010057B2 (en) Image processing system and setting method
JP4150390B2 (en) Appearance inspection method and appearance inspection apparatus
US20150022637A1 (en) Three-Dimensional Image Processing Apparatus, Three-Dimensional Image Processing Method, Three-Dimensional Image Processing Program, Computer-Readable Recording Medium, And Recording Device
JP2015038466A (en) Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and device for storage
JP2015143139A (en) Apparatus for detecting agitated state in refuse pit and method of detecting agitated state in refuse pit
JP6642776B1 (en) Inspection device and inspection method
JP3533722B2 (en) Failure inspection method and device
JP2015021763A (en) Three-dimensional image processor, three-dimensional image processing method, three-dimensional image processing program, and computer-readable recording medium
JP2018136340A (en) Visual inspection device
JP2006155579A (en) Image processing method and image processing apparatus
JP4743231B2 (en) Appearance inspection method and appearance inspection apparatus
KR20150068884A (en) Semiconductor inspecting method, semiconductor inspecting apparatus and semiconductor manufacturing method
US11796308B2 (en) Three-dimensional measuring apparatus, three-dimensional measuring method
EP4220570A1 (en) Three-dimensional modeling method and apparatus using same
JP4190243B2 (en) Electronic circuit component visual inspection method, visual inspection apparatus, and electronic circuit component manufacturing method.
JP4743230B2 (en) Appearance inspection method and appearance inspection apparatus
JP2018112568A (en) Appearance inspection device
JP4178923B2 (en) Appearance inspection method and appearance inspection apparatus
JP3584507B2 (en) Pattern unevenness inspection equipment
JP5509706B2 (en) Image processing apparatus and image processing method
JPH05164703A (en) Inspecting method for surface of workpiece
JP5402182B2 (en) Appearance inspection method and appearance inspection apparatus

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190802

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190802

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20190802

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20190830

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190903

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190926

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191216

R151 Written notification of patent or utility model registration

Ref document number: 6642776

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees