JP2021173644A - Lens visual inspection device and machine learning device - Google Patents

Lens visual inspection device and machine learning device Download PDF

Info

Publication number
JP2021173644A
JP2021173644A JP2020077654A JP2020077654A JP2021173644A JP 2021173644 A JP2021173644 A JP 2021173644A JP 2020077654 A JP2020077654 A JP 2020077654A JP 2020077654 A JP2020077654 A JP 2020077654A JP 2021173644 A JP2021173644 A JP 2021173644A
Authority
JP
Japan
Prior art keywords
lens
inspection
illumination
camera
condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2020077654A
Other languages
Japanese (ja)
Inventor
典弘 竹本
Norihiro Takemoto
圭二 高橋
Keiji Takahashi
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.)
MIRAPURO KK
Mirapro Co Ltd
Tokai Optical Co Ltd
Original Assignee
MIRAPURO KK
Mirapro Co Ltd
Tokai Optical Co Ltd
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 MIRAPURO KK, Mirapro Co Ltd, Tokai Optical Co Ltd filed Critical MIRAPURO KK
Priority to JP2020077654A priority Critical patent/JP2021173644A/en
Publication of JP2021173644A publication Critical patent/JP2021173644A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

To provide a lens visual inspection device and a machine learning device, which can suitably inspect various lenses without requiring much time and effort.SOLUTION: A lens visual inspection device 1 comprises: narrow-angle light irradiation means 7 capable of irradiating a spectacle lens L with illumination light; a camera 8 for imaging first to fourth images C1-C4 for inspection which are needed for a synthesized image E for inspection in which the spectacle lens L is included; and a machine learning program 54 for learning, through a machine, how to determine an illumination condition with respect to irradiation of illumination light by the narrow-angle irradiation means 7. The machine learning program 54 includes: a state observation part 60 for observing a state variable pertaining to the illumination condition and the state of abnormality determination in the synthesized image E for inspection; and a learning part 62 for updating an action value function that determines the illumination condition on the basis of the state variable and thereby learning how to determine the illumination condition. The learning part 62 repeats the updating of the action value function by a function updating part 74 and thereby learns the illumination condition with which the largest possible remuneration is obtained.SELECTED DRAWING: Figure 1

Description

本発明は、眼鏡レンズ、カメラレンズ等のレンズの外観を検査するレンズ外観検査装置、及び当該装置に係る機械学習を行う機械学習装置に関する。 The present invention relates to a lens appearance inspection device for inspecting the appearance of lenses such as spectacle lenses and camera lenses, and a machine learning device for performing machine learning related to the device.

レンズ用画像撮像装置として、特開2018−59927号公報(特許文献1)のものが知られている。
この装置では、図39に記載されるように、検査対象であるレンズの側方から、照明光を、高さ及び角度の少なくとも一方(照明条件)を様々に変化可能な状態で当てており、眼鏡レンズのようにカーブを有するレンズを始めとする様々なレンズに対して、照明光の高さ、角度をレンズに合ったものとして、適切な検査が行われ得る。
As an image imaging device for a lens, Japanese Patent Application Laid-Open No. 2018-59927 (Patent Document 1) is known.
In this device, as shown in FIG. 39, illumination light is applied from the side of the lens to be inspected in a state in which at least one of the height and the angle (illumination condition) can be variously changed. Appropriate inspection can be performed on various lenses including curved lenses such as spectacle lenses, assuming that the height and angle of the illumination light match the lens.

特開2018−59927号公報JP-A-2018-59927

この装置では、精度の良好な検査が行われ得るものの、カーブ値、半径等の特性の異なるレンズの種類に応じた最適な照明条件を事前に見出し、データベースとして記憶させておくことに手間がかかる。
又、特性が具体的に判明していないレンズを検査する場合、最適な照明条件の選択に試行錯誤が必要となり、手間がかかる。
Although this device can perform inspections with good accuracy, it takes time to find out in advance the optimum lighting conditions for different types of lenses with different characteristics such as curve values and radii, and store them in a database. ..
Further, when inspecting a lens whose characteristics are not specifically known, trial and error is required to select the optimum lighting conditions, which is troublesome.

そこで、本発明は、様々なレンズを手間の少ない状態で適切に検査可能なレンズ外観検査装置,機械学習装置を提供することを主な目的とするものである。 Therefore, it is a main object of the present invention to provide a lens appearance inspection device and a machine learning device capable of appropriately inspecting various lenses with less effort.

上記目的を達成するために、請求項1に記載の発明は、レンズ外観検査装置において、検査対象レンズに対して照明光を照射可能な照明光照射手段と、前記検査対象レンズが含まれる検査用画像を撮像するカメラと、前記照明光照射手段による前記照明光の照射についての照明条件、及び前記カメラによる前記検査用画像の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習手段と、を備えており、前記機械学習手段は、前記照明条件及び前記カメラ条件の少なくとも何れかと、前記検査用画像における異常判定の状態とに係る状態変数を観測する状態観測部と、前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定する関数を更新することによって、前記照明条件及び前記カメラ条件の少なくとも何れかを決定することを学習する学習部と、を有しており、前記学習部は、前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部と、前記報酬計算部により計算された報酬に基づいて、前記関数を更新する関数更新部と、を有しており、前記関数更新部による前記関数の更新を繰り返すことによって、前記報酬が最も多く得られる前記照明条件及び前記カメラ条件の少なくとも何れかを学習することを特徴とするものである。
請求項2に記載の発明は、上記発明にあって、前記照明光照射手段は、前記検査対象レンズに対する前記照明光の照明角度及び照明高さの少なくとも一方を相対的に変更可能であり、前記照明条件は、前記照明角度及び前記照明高さの少なくとも一方を含むことを特徴とするものである。
請求項3に記載の発明は、上記発明にあって、前記検査対象レンズと前記カメラとの間の距離である撮像距離を調整する撮像距離調整手段を備えており、前記カメラ条件は、前記撮像距離、露光時間、及びゲインの内の少なくとも何れかを含むことを特徴とするものである。
請求項4に記載の発明は、上記発明にあって、前記検査用画像を処理する制御手段を備えており、前記照明光照射手段は、前記検査対象レンズの光軸を囲む囲み線の一部にそれぞれ相当する部分を占める複数の照明部分から、前記照明光を切替えて照射可能であり、前記カメラは、前記照明光照射手段による複数の前記照明部分における照射毎に前記検査用画像を撮像し、前記制御手段は、複数の前記照明部分の照射毎に撮像した前記検査用画像中の前記検査対象レンズの撮像部分における、前記照明部分が映り込んだ部分をそれぞれ消去して、複数の検査用マスク画像を生成する一部消去処理と、複数の前記検査用マスク画像を合成して検査用合成画像を生成する合成処理と、を行うことを特徴とするものである。
請求項5に記載の発明は、上記発明において、前記照明光照射手段における前記囲み線は、前記検査対象レンズを囲む円環又は正多角形であり、前記照明光照射手段における前記照明部分は、前記円環又は前記正多角形を均等に分割した場合の前記円環の部分又は前記正多角形の部分であり、前記制御手段の前記一部消去処理における消去対象部分は、前記検査用画像をその中心から発する放射方向の直線で均等に分割した場合の前記検査用画像の部分であることを特徴とするものである。
請求項6に記載の発明は、上記発明において、前記照明光は、指向角が30°以下の狭角光であることを特徴とするものである。
請求項7に記載の発明は、上記発明において、前記カメラは、前記検査対象レンズに向けられたカメラレンズを有しており、前記カメラレンズは、物体側テレセントリックレンズ又は両側テレセントリックレンズであることを特徴とするものである。
請求項8に記載の発明は、上記発明において、内面が反射防止面とされている箱体を備えており、前記箱体は、孔を有しており、前記検査対象レンズを挟んで前記カメラと反対側に前記孔が位置するように配置されていることを特徴とするものである。
請求項9に記載の発明は、上記発明において、前記検査対象レンズ及び前記照明光照射手段、並びに、前記カメラを覆うエンクロージャを備えており、前記エンクロージャの内面は、前記照明光の反射が防止される反射防止面とされていることを特徴とするものである。
上記目的を達成するために、請求項10に記載の発明は、検査対象レンズに対する照明光の照射についての照明条件、及びカメラによる検査用画像の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習装置であって、前記照明条件及び前記カメラ条件の少なくとも何れかと、前記検査用画像における異常判定の状態とに係る状態変数を観測する状態観測部と、前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定する関数を更新することによって、前記照明条件及び前記カメラ条件の少なくとも何れかを決定することを学習する学習部と、を有しており、前記学習部は、前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部と、前記報酬計算部により計算された報酬に基づいて、前記関数を更新する関数更新部と、を有しており、前記関数更新部による前記関数の更新を繰り返すことによって、前記報酬が最も多く得られる前記照明条件及び前記カメラ条件の少なくとも何れかを学習することを特徴とするものである。
In order to achieve the above object, the invention according to claim 1 is for an inspection including an illumination light irradiation means capable of irradiating an inspection target lens with illumination light and the inspection target lens in the lens appearance inspection apparatus. A machine that machine-learns to determine at least one of a camera that captures an image, a lighting condition for irradiating the illumination light by the illumination light irradiation means, and a camera condition for capturing the inspection image by the camera. The machine learning means includes a state observing unit for observing at least one of the lighting condition and the camera condition, and a state variable related to an abnormality determination state in the inspection image, and the above. A learning unit that learns to determine at least one of the lighting condition and the camera condition by updating a function that determines at least one of the lighting condition and the camera condition based on a state variable. The learning unit is calculated by the reward calculation unit and the reward calculation unit that calculate the reward for the result of determining at least one of the lighting condition and the camera condition based on the state variable. It has a function update unit that updates the function based on the reward, and by repeating the update of the function by the function update unit, the lighting condition and the camera condition that the most reward can be obtained. It is characterized by learning at least one of them.
The invention according to claim 2 is the invention, wherein the illumination light irradiation means can relatively change at least one of the illumination angle and the illumination height of the illumination light with respect to the inspection target lens. The illumination condition is characterized by including at least one of the illumination angle and the illumination height.
The invention according to claim 3 includes the imaging distance adjusting means for adjusting the imaging distance, which is the distance between the lens to be inspected and the camera, and the camera conditions are the imaging. It is characterized by including at least one of a distance, an exposure time, and a gain.
The invention according to claim 4 includes the control means for processing the inspection image, and the illumination light irradiation means is a part of a surrounding line surrounding the optical axis of the inspection target lens. It is possible to switch and irradiate the illumination light from a plurality of illumination portions occupying the portions corresponding to the above, and the camera captures the inspection image for each irradiation in the plurality of illumination portions by the illumination light irradiation means. The control means erases the portion in which the illuminated portion is reflected in the imaged portion of the inspection target lens in the inspection image captured for each irradiation of the plurality of illuminated portions, and is used for a plurality of inspections. It is characterized in that a partial erasing process for generating a mask image and a compositing process for compositing a plurality of the inspection mask images to generate an inspection composite image are performed.
According to the fifth aspect of the present invention, in the above invention, the surrounding line in the illumination light irradiation means is a ring or a regular polygon surrounding the inspection target lens, and the illumination portion in the illumination light irradiation means is. The portion of the ring or the portion of the regular polygon when the ring or the regular polygon is evenly divided, and the portion to be erased in the partial erasing process of the control means is the inspection image. It is characterized in that it is a part of the inspection image when it is evenly divided by a straight line in the radial direction emanating from the center.
The invention according to claim 6 is characterized in that, in the above invention, the illumination light is a narrow angle light having a directivity angle of 30 ° or less.
According to the invention of claim 7, in the above invention, the camera has a camera lens directed to the lens to be inspected, and the camera lens is an object-side telecentric lens or a bilateral telecentric lens. It is a feature.
The invention according to claim 8 includes a box body whose inner surface is an antireflection surface in the above invention, and the box body has a hole, and the camera sandwiches the lens to be inspected. It is characterized in that the hole is arranged so as to be located on the opposite side of the hole.
The invention according to claim 9 includes, in the above invention, the lens to be inspected, the illumination light irradiation means, and an enclosure covering the camera, and the inner surface of the enclosure is prevented from reflecting the illumination light. It is characterized by being an antireflection surface.
In order to achieve the above object, the invention according to claim 10 determines at least one of an illumination condition for irradiating an inspection target lens with illumination light and a camera condition for capturing an inspection image by a camera. A state observation unit that observes a state variable related to at least one of the lighting condition and the camera condition, and a state of abnormality determination in the inspection image, and a state observation unit based on the state variable. It also has a learning unit that learns to determine at least one of the illumination condition and the camera condition by updating a function that determines at least one of the illumination condition and the camera condition. , The learning unit is based on a reward calculation unit that calculates a reward for a result of determining at least one of the lighting condition and the camera condition based on the state variable, and a reward calculated by the reward calculation unit. It has a function update unit that updates the function, and by repeating the update of the function by the function update unit, at least one of the illumination condition and the camera condition from which the reward is most obtained can be obtained. It is characterized by learning.

本発明によれば、様々なレンズを手間なく適切に検査可能なレンズ外観検査装置,機械学習装置を提供することが可能となる、という効果を奏する。 According to the present invention, it is possible to provide a lens appearance inspection device and a machine learning device capable of appropriately inspecting various lenses without hassle.

本発明に係るレンズ外観検査装置の縦中央断面模式図及びブロック図である。It is a vertical center cross-sectional schematic diagram and a block diagram of the lens appearance inspection apparatus which concerns on this invention. 図1における狭角光照明手段の上面図である。It is a top view of the narrow-angle light illumination means in FIG. 図1の装置におけるレンズ外観検査の動作例に係るフローチャートである。It is a flowchart which concerns on the operation example of the lens appearance inspection in the apparatus of FIG. 図1の装置の動作例に係る各種の画像の模式図である。It is a schematic diagram of various images which concerns on the operation example of the apparatus of FIG. 図1における機械学習プログラムのブロック図である。It is a block diagram of the machine learning program in FIG. 図1の装置における機械学習の動作例に係るフローチャートである。It is a flowchart which concerns on the operation example of the machine learning in the apparatus of FIG. 所定のマイナスレンズを検査対象として報酬が増える場合の検査用合成画像E(白黒反転処理後)の例である。This is an example of a composite image E (after black-and-white inversion processing) for inspection when a predetermined minus lens is used as an inspection target and the reward is increased. 図7の一部拡大図である。It is a partially enlarged view of FIG. 図7のマイナスレンズを検査対象として報酬が増えない場合の検査用合成画像E(白黒反転処理後)の例である。This is an example of a composite image E (after black-and-white inversion processing) for inspection when the minus lens of FIG. 7 is the inspection target and the reward does not increase. 図9の一部拡大図である。It is a partially enlarged view of FIG. 所定のプラスレンズを検査対象として報酬が増える場合の検査用合成画像E(白黒反転処理後)の例である。This is an example of a composite image E (after black-and-white inversion processing) for inspection when a predetermined positive lens is used as an inspection target and the reward is increased. 図11の一部拡大図である。It is a partially enlarged view of FIG. 図11のプラスレンズを検査対象として報酬が増えない場合の検査用合成画像E(白黒反転処理後)の例である。This is an example of a composite image E (after black-and-white inversion processing) for inspection when the reward does not increase with the plus lens of FIG. 11 as the inspection target. 図13の一部拡大図である。It is a partially enlarged view of FIG.

以下、本発明に係る実施の形態の例が、適宜図面を用いて説明される。
尚、本発明の形態は、以下のものに限定されない。
Hereinafter, examples of embodiments according to the present invention will be described with reference to the drawings as appropriate.
The form of the present invention is not limited to the following.

≪構成等≫
図1は、本発明に係るレンズ外観検査装置1の縦中央断面模式図及びブロック図である。
レンズ外観検査装置1は、眼鏡レンズLの外観を検査するものである。
レンズ外観検査装置1は、エンクロージャ2と、ステージ4(箱体)と、レンズ保持機構6と、照明光照射手段としての狭角光照射手段7と、カメラ8と、報知手段9と、これらを制御する制御手段12と、を備えている。
尚、レンズ外観検査装置1は、カーブの深い(曲率半径の小さい)ものが多く含まれる眼鏡レンズLの検査に適しているところ、眼鏡レンズL以外の(カーブの深いあるいは肉厚の大きい)レンズの検査に用いられても良い。又、エンクロージャ2、レンズ保持機構6、及び報知手段9の少なくとも何れかは、省略されても良い。更に、レンズ外観検査装置1は、レンズに関する他の検査を行う各種検査装置と組み合わせられても良い。加えて、以下のレンズ外観検査装置1が複数組み合わせられることでレンズ外観検査装置が構成されても良い。
≪Composition, etc.≫
FIG. 1 is a schematic vertical center sectional view and a block diagram of the lens appearance inspection device 1 according to the present invention.
The lens appearance inspection device 1 inspects the appearance of the spectacle lens L.
The lens appearance inspection device 1 includes an enclosure 2, a stage 4 (box body), a lens holding mechanism 6, a narrow-angle light irradiation means 7 as an illumination light irradiation means, a camera 8, a notification means 9, and these. A control means 12 for controlling is provided.
The lens appearance inspection device 1 is suitable for inspecting a spectacle lens L including many lenses having a deep curve (small radius of curvature), but a lens other than the spectacle lens L (deep curve or thick wall). It may be used for the inspection of. Further, at least one of the enclosure 2, the lens holding mechanism 6, and the notification means 9 may be omitted. Further, the lens appearance inspection device 1 may be combined with various inspection devices for performing other inspections related to the lens. In addition, the lens appearance inspection device may be configured by combining a plurality of the following lens appearance inspection devices 1.

エンクロージャ2は、閉塞可能な箱状であり、遮光性材料によって形成されている。
エンクロージャ2の内面には、光の反射率を低減させることで光の反射を防止する反射防止加工が施されており、エンクロージャ2の内面は、光の反射が防止される反射防止面とされていて、ここでは黒色を呈するように形成されている(黒化処理)。
尚、反射防止フィルムを貼着することで、反射防止フィルム付きのエンクロージャ2内面が形成され、エンクロージャ2内面の反射防止面が形成されても良い。
The enclosure 2 has a box shape that can be closed and is made of a light-shielding material.
The inner surface of the enclosure 2 is anti-reflection processed to prevent light reflection by reducing the reflectance of light, and the inner surface of the enclosure 2 is an anti-reflection surface that prevents light reflection. Here, it is formed so as to exhibit black color (blackening treatment).
By attaching the antireflection film, the inner surface of the enclosure 2 with the antireflection film may be formed, and the antireflection surface of the inner surface of the enclosure 2 may be formed.

ステージ4は、箱状であり、エンクロージャ2の内側下部に配置される。
ステージ4は、水平な天板3を有している。
天板3の中央部には、孔5が開けられている。
ステージ4は、撮像距離調整手段としてのリフト20によって、天板3を水平姿勢に保ったまま上下動可能に支持されている。
尚、ステージ4(箱体)は、眼鏡レンズLの下方に位置する内面に光がなるべく当たらないように当該内面を囲む形状であれば足り、完全に閉塞されている必要はなく、窓及び扉の少なくとも一方等の開口部が存在していても良い。あるいは、リフト20は、省略されても良い。又、ステージ4の一部が上下動可能に支持されても良い。更に、ステージ4あるいはその一部は、リフト20あるいは他の手段によって、左右に移動可能とされても良い。
ステージ4の外面は黒色とされており、ステージ4の内面は、黒色のスクリーンが貼られることで黒化処理されている。
The stage 4 has a box shape and is arranged in the lower inside of the enclosure 2.
The stage 4 has a horizontal top plate 3.
A hole 5 is formed in the central portion of the top plate 3.
The stage 4 is supported by a lift 20 as an imaging distance adjusting means so that the top plate 3 can move up and down while being kept in a horizontal posture.
The stage 4 (box body) need only have a shape that surrounds the inner surface located below the spectacle lens L so that light does not hit the inner surface as much as possible, and does not need to be completely closed, and the window and door do not need to be completely closed. There may be an opening such as at least one of the above. Alternatively, the lift 20 may be omitted. Further, a part of the stage 4 may be supported so as to be vertically movable. Further, the stage 4 or a part thereof may be movable to the left or right by the lift 20 or other means.
The outer surface of the stage 4 is black, and the inner surface of the stage 4 is blackened by attaching a black screen.

レンズ保持機構6は、孔5の周囲に配置される。
レンズ保持機構6は、検査対象レンズとしての眼鏡レンズLを保持する機構であり、8個のフック21を有する。
各フック21は、断面L字状である。各フック21の一方の面状部分は、孔5の内側(天板3の下面)に対して固定されており、他方の面状部分は、起立姿勢となっていて、その上部において眼鏡レンズLの周縁を支持する。各フック21における起立部分は、透光性を有するところ、照明光を阻害しなければ透光性を有していなくても良い。
8個のフック21は、狭角光照射手段7のベース22における正八角形の何れかの頂点に相当する位置に配置されている。即ち、8個のフック21は、正八角形の何れかの頂点とその中心とを結ぶ仮想線上に配置されている。各フック21は、互いに向かい合う対を4つ有するように配置され、眼鏡レンズLの外径に応じて、各対におけるフック21間のの距離(フック21が載る仮想的な正八角形の大きさ)が調整される。
尚、フック21の数は、7個以下でも良いし、9個以上であっても良い。フック21の固定は、孔5の内側以外に対するものであっても良い。又、レンズ保持機構6は、フランジ付きの円筒状部材であっても良く、この場合に内径の大きさ(内側形状)を眼鏡レンズLの外径(外側形状)に合致させる内径調整手段(形状調整手段)を備えるようにしても良い。更に、レンズ保持機構6の材質は、樹脂、セラミックス、ガラス、金属、ゴムあるいはこれらの組合せとされても良い。
The lens holding mechanism 6 is arranged around the hole 5.
The lens holding mechanism 6 is a mechanism for holding the spectacle lens L as the lens to be inspected, and has eight hooks 21.
Each hook 21 has an L-shaped cross section. One planar portion of each hook 21 is fixed to the inside of the hole 5 (lower surface of the top plate 3), and the other planar portion is in an upright posture, and the spectacle lens L is above the surface portion. Support the periphery of. Where the standing portion of each hook 21 has translucency, it does not have to be translucent as long as it does not interfere with the illumination light.
The eight hooks 21 are arranged at positions corresponding to any of the vertices of the regular octagon on the base 22 of the narrow-angle light irradiation means 7. That is, the eight hooks 21 are arranged on a virtual line connecting any apex of the regular octagon and its center. Each hook 21 is arranged so as to have four pairs facing each other, and the distance between the hooks 21 in each pair according to the outer diameter of the spectacle lens L (the size of a virtual regular octagon on which the hook 21 rests). Is adjusted.
The number of hooks 21 may be 7 or less, or 9 or more. The hook 21 may be fixed to a position other than the inside of the hole 5. Further, the lens holding mechanism 6 may be a cylindrical member with a flange, and in this case, the inner diameter adjusting means (shape) for matching the size of the inner diameter (inner shape) with the outer diameter (outer shape) of the spectacle lens L. Adjustment means) may be provided. Further, the material of the lens holding mechanism 6 may be resin, ceramics, glass, metal, rubber, or a combination thereof.

図2にも示される狭角光照射手段7は、ベース22と、複数(8個)の照射ユニット23と、を備えている。 The narrow-angle light irradiation means 7 also shown in FIG. 2 includes a base 22 and a plurality (8) irradiation units 23.

ベース22は、上からみて正八角形である水平な枠状である。
ベース22は、後部に正八角形の枠状部分から後方に延設される延設部(図示略)を有しており、その延設部を通過する上下方向のレール25に沿って移動可能である(狭角光照射手段7の位置変更に係る照射変更手段)。かようなベース22の上下方向の移動は、図示されないモータにより行われ、制御手段12の制御により任意の位置まで移動可能である。レール25は、エンクロージャ2に対して固定され、エンクロージャ2内面と同様に、反射防止加工が施されている。
ベース22及び8個の照射ユニット23は、眼鏡レンズLを囲む。ベース22及び8個の照射ユニット23の八角形の中心と、眼鏡レンズLの中心とは、ここでは合致している。
The base 22 has a horizontal frame shape that is a regular octagon when viewed from above.
The base 22 has an extension portion (not shown) extending rearward from a regular octagonal frame-shaped portion at the rear portion, and is movable along a vertical rail 25 passing through the extension portion. There is (irradiation changing means relating to the position change of the narrow angle light irradiating means 7). Such vertical movement of the base 22 is performed by a motor (not shown), and the base 22 can be moved to an arbitrary position under the control of the control means 12. The rail 25 is fixed to the enclosure 2 and is subjected to antireflection processing like the inner surface of the enclosure 2.
The base 22 and the eight irradiation units 23 surround the spectacle lens L. The center of the octagon of the base 22 and the eight irradiation units 23 and the center of the spectacle lens L match here.

各照射ユニット23は、ベース22の各辺の下部に配置されている。
各照射ユニット23は、ユニットボックス28と、複数(14個)の狭角光LED24と、複数(14個)の照明用レンズ26と、傾斜角調節手段27と、を有している。
尚、照射ユニット23は、7個以下でも良いし、9個以上であっても良い。
Each irradiation unit 23 is arranged at the lower part of each side of the base 22.
Each irradiation unit 23 includes a unit box 28, a plurality (14) narrow-angle light LEDs 24, a plurality (14) illumination lenses 26, and an inclination angle adjusting means 27.
The number of irradiation units 23 may be 7 or less, or 9 or more.

各ユニットボックス28は、長尺の箱状である。
各狭角光LED24は、所定数(14個)毎に、各ユニットボックス28内に配設されている。
各狭角光LED24は、白色の略狭角光を発する。狭角光は、指向角が30°以下の光であり、指向角が0°である平行光を含んでいる。略狭角光は、殆ど狭角光であるものの、完全な狭角光に近づけるための微調整の余地が残されている光であり、例えば30°を僅かに超えた指向角で発散する(遠方において広がりが認められる)光、あるいは電圧等の条件によって指向角が変化することでかような発散が見受けられる光である。
各狭角光LED24は、発光方向が中央に向かうように設置されている。
尚、各狭角光LED24は、白色以外の色の略狭角光を発しても良いし、紫外線及び赤外線の少なくとも一方を含む可視光以外の略狭角光を発しても良いし、これらを組合せた略狭角光を発しても良い。又、狭角光LED24は、平行光又は略平行光を発する平行光LEDであっても良い。略平行光は、殆ど平行光であるものの、完全な平行光に近づけるための微調整の余地が残されている光であり、僅かに集束する(集束点が遠方ではあるが存在する)光、あるいは僅かに発散する(遠方において広がりが認められる)光、又は電圧等の条件によって僅かに集束及び発散の少なくとも一方が変化する光である。更に、狭角光LED24に代えて、狭角光あるいは略狭角光ではない光(広角光)を発する光源が用いられても良い。以下、かような広角光及び狭角光は、合わせて照明光と呼ばれることがある。
Each unit box 28 has a long box shape.
Each of the narrow-angle optical LEDs 24 is arranged in each unit box 28 in a predetermined number (14).
Each narrow-angle light LED 24 emits white substantially narrow-angle light. The narrow-angle light is light having a directivity angle of 30 ° or less, and includes parallel light having a directivity angle of 0 °. Approximately narrow-angle light is almost narrow-angle light, but there is still room for fine adjustment to approach perfect narrow-angle light. For example, it diverges at a directivity angle slightly exceeding 30 ° (). Light that spreads in the distance), or light that diverges when the directional angle changes depending on conditions such as voltage.
Each narrow-angle light LED 24 is installed so that the light emitting direction faces the center.
Each narrow-angle light LED 24 may emit substantially narrow-angle light of a color other than white, or may emit substantially narrow-angle light other than visible light including at least one of ultraviolet rays and infrared rays. The combined substantially narrow-angle light may be emitted. Further, the narrow-angle light LED 24 may be a parallel light LED that emits parallel light or substantially parallel light. Approximately parallel light is light that is almost parallel light, but leaves room for fine adjustment to approach perfect parallel light, and is slightly focused (although the focusing point is distant). Alternatively, it is light that diverges slightly (spreading is observed in the distance), or light whose focusing and divergence change slightly depending on conditions such as voltage. Further, instead of the narrow-angle light LED 24, a light source that emits light (wide-angle light) that is not narrow-angle light or substantially narrow-angle light may be used. Hereinafter, such wide-angle light and narrow-angle light may be collectively referred to as illumination light.

各照明用レンズ26は、狭角光LED24毎に設けられる。
各照明用レンズ26は、ユニットボックス28内において、対応する狭角光LED24の内方に配置されており、狭角光LED24から発出された略狭角光の光路を微調整して、狭角光とするものである。尚、照明用レンズ26は、略狭角光若しくは狭角光又は略平行光を平行光とするものであっても良い。又、照明用レンズ26は、狭角光LED24と一体としても良いし、複数の狭角光LED24に共通するものとしても良いし、省略しても良い。又、狭角光を発する手段は狭角光LED24と照明用レンズ26の組合せに限られず、レーザ励起体等であっても良い。
Each illumination lens 26 is provided for each narrow-angle light LED 24.
Each illumination lens 26 is arranged inside the corresponding narrow-angle light LED 24 in the unit box 28, and finely adjusts the optical path of the substantially narrow-angle light emitted from the narrow-angle light LED 24 to narrow the angle. It is a light. The illumination lens 26 may have substantially narrow-angle light, narrow-angle light, or substantially parallel light as parallel light. Further, the illumination lens 26 may be integrated with the narrow-angle optical LED 24, may be common to a plurality of narrow-angle optical LEDs 24, or may be omitted. Further, the means for emitting narrow-angle light is not limited to the combination of the narrow-angle light LED 24 and the illumination lens 26, and may be a laser exciter or the like.

各ユニットボックス28は、ベース22の外側下部に対して、傾斜角調節手段27を介して接続されている。各傾斜角調節手段27は、例えばアクチュエータにより形成され、制御手段12の制御により、対応する照射ユニット23の向き(仮想的な水平面に対する傾斜角)を、任意の向き(傾斜角)に変える(狭角光照射手段7の傾斜角変更に係る照射変更手段)。照射ユニット23は、傾斜角調節手段27により、上向き(水平面より上方に向かう向き)から、水平な向き(水平面と同じ向き)を経て、下向き(水平面より下方に向かう向き)まで姿勢変化可能である。制御手段12は、8個の照射ユニット23について、互いに独立して傾斜角を変化可能である。又、制御手段12は、複数(例えば右の4個あるいは全8個)の照射ユニット23が同じ傾斜角を持つように制御することもできる。
8個の照射ユニット23は、ベース22によって上下方向に移動可能とされ、その移動(到達位置)の制御のために、制御手段12と電気的に接続されている。これら照射ユニット23は、リフト20とは独立して上下方向に移動可能である。
尚、各照射ユニット23は、互いに独立して移動可能とされていても良い。又、各照射ユニット23は、ベース22の正八角形に接する仮想的な円の径方向等の他の方向においても移動可能とされていても良い。更に、一部の照射ユニット23について、他の照射ユニット23に対して互いに独立して位置及び傾斜角の少なくとも一方の変化が可能であるようにされても良い。加えて、狭角光照射手段7は、上下方向の位置及び傾斜角の何れか一方のみについて変更可能とされても良い。又、照射ユニット23の一部又は全部は、ベース22の上部に配置されていても良いし、ベース22の外側面に配置されていても良いし、ベース22の内側面に配置されていても良いし、ベース22の下面の中央あるいは内方側に配置されていても良い。
Each unit box 28 is connected to the lower outer side of the base 22 via an inclination angle adjusting means 27. Each inclination angle adjusting means 27 is formed by, for example, an actuator, and the direction (inclination angle with respect to a virtual horizontal plane) of the corresponding irradiation unit 23 is changed to an arbitrary direction (inclination angle) by the control of the control means 12 (narrow). Irradiation changing means for changing the tilt angle of the angular light irradiating means 7). The irradiation unit 23 can change its posture from upward (direction upward from the horizontal plane), horizontally (same direction as the horizontal plane), and downward (direction downward from the horizontal plane) by the inclination angle adjusting means 27. .. The control means 12 can change the inclination angles of the eight irradiation units 23 independently of each other. Further, the control means 12 can also control a plurality of (for example, four on the right or a total of eight) irradiation units 23 so as to have the same inclination angle.
The eight irradiation units 23 are made movable in the vertical direction by the base 22, and are electrically connected to the control means 12 for controlling the movement (arrival position). These irradiation units 23 can move in the vertical direction independently of the lift 20.
The irradiation units 23 may be movable independently of each other. Further, each irradiation unit 23 may be movable in another direction such as the radial direction of a virtual circle in contact with the regular octagon of the base 22. Further, for some irradiation units 23, at least one of the position and the inclination angle may be changed independently of the other irradiation units 23. In addition, the narrow-angle light irradiating means 7 may be capable of changing only one of the vertical position and the tilt angle. Further, a part or all of the irradiation unit 23 may be arranged on the upper part of the base 22, may be arranged on the outer surface of the base 22, or may be arranged on the inner surface of the base 22. Alternatively, it may be arranged in the center or inward side of the lower surface of the base 22.

又、各照射ユニット23は、互いに独立して点消灯可能であるように、制御手段12と電気的に接続されている。例えば、照射ユニット23は、ベース22の正八角形の右上の上側の辺におけるものから、1個置きに4個点灯することが可能である。又、照射ユニット23は、図2で示されるように、上側から下方へ見たときの右上の上下2個の照射ユニット23に係る第1照明部分M1,右下の上下2個の照射ユニット23に係る第2照明部分M2,左下の上下2個の照射ユニット23に係る第3照明部分M3あるいは左上の上下2個の照射ユニット23に係る第4照明部分M4の4箇所の部分毎に、オンオフを切替可能に接続されている(部分照明,分割照明)。第1照明部分M1は、眼鏡レンズLを取り囲む360°のうちの90°の範囲を照らす。第2照明部分M2,第3照明部分M3,第4照明部分M4についても、同様である。
尚、かような照明部分の分割数は、4未満であっても良いし、4を超えていても良い。又、各照明部分における狭角光LED24の数は、同一であることが好ましいが(均等分割)、一部あるいは全部において互いに相違していても良い。更に、少なくとも2つの照明部分が互いにオーバーラップしていても良い。加えて、照明部分の集合が眼鏡レンズLを360°取り囲むことが好ましいところ、狭角光照射手段7が照明部分の配置されない箇所(隙間等)を有することによって、照明部分の集合が眼鏡レンズLを360°取り囲まなくても良い。又、狭角光LED24,24・・は、多角形あるいは楕円等の、眼鏡レンズLの光軸を囲む円環以外の任意の囲み線に沿うように配置されて良く、照明部分はその一部を占めるようにされて良い。
Further, each irradiation unit 23 is electrically connected to the control means 12 so that the lights can be turned on and off independently of each other. For example, four irradiation units 23 can be lit every other one from the one on the upper right side of the upper right side of the regular octagon of the base 22. Further, as shown in FIG. 2, the irradiation unit 23 includes a first illumination portion M1 related to two upper and lower irradiation units 23 on the upper right when viewed from the upper side and two upper and lower irradiation units 23 on the lower right. On / off for each of the four parts of the second lighting portion M2 according to the above two, the third lighting portion M3 related to the upper and lower two irradiation units 23 on the lower left, or the fourth lighting portion M4 related to the two upper and lower irradiation units 23 on the upper left. Are connected so that they can be switched (partial lighting, split lighting). The first illumination portion M1 illuminates a range of 90 ° out of 360 ° surrounding the spectacle lens L. The same applies to the second illuminating portion M2, the third illuminating portion M3, and the fourth illuminating portion M4.
The number of divisions of such an illuminated portion may be less than 4 or more than 4. Further, the number of narrow-angle light LEDs 24 in each illumination portion is preferably the same (equal division), but may be partially or completely different from each other. Further, at least two illuminated portions may overlap each other. In addition, where it is preferable that the set of illuminated portions surrounds the spectacle lens L by 360 °, the narrow-angle light irradiating means 7 has a portion (gap or the like) where the illuminated portion is not arranged, so that the set of illuminated portions is formed by the spectacle lens L. It is not necessary to surround 360 °. Further, the narrow-angle optical LEDs 24, 24 ... May be arranged along an arbitrary encircling line other than the ring surrounding the optical axis of the spectacle lens L, such as a polygon or an ellipse, and the illuminating portion is a part thereof. May be made to occupy.

そして、各フック21の上側(検査位置)に、眼鏡レンズLがセットされる。眼鏡レンズLの光軸は、鉛直方向を向き、眼鏡レンズLが凸レンズである場合には凸面が下となるように配置され、眼鏡レンズLが凹レンズである場合には凹面が上となるように配置される。狭角光照射手段7は、周方向の全体に亘り配置された各狭角光LED24及び各照明用レンズ26を有するので、眼鏡レンズLの周囲全体を照らす。尚、眼鏡レンズLの向きは、上述と逆であっても良いところ、上述の向きであれば各レンズの散乱光をより適切に撮像し易くなる。
各狭角光LED24から出た略狭角光は、何れもその狭角光LED24の向きに平行であり、対応する照明用レンズ26により狭角光となって、眼鏡レンズLに向かって、大きく広がることなく、又急に集束することなく、略真っ直ぐ進む。各照明用レンズ26から出た狭角光の方向は、眼鏡レンズLの光軸に交わる方向であり、より詳しくはその光軸に直交あるいは斜行する方向である。各狭角光LED24の発光部は、所定の大きさ(例えば直径2mm(ミリメートル)の円盤)を有しており、各狭角光LED24ないし照明用レンズ26からの狭角光に係る進行方向に垂直な断面の大きさは、その発光部の大きさから指向角の分だけ広がって行く。
狭角光がレンズ保持機構6に至る場合であっても、少なくともその到達部分(各フック21の起立部分)が透光性を有するから、狭角光はレンズ保持機構6を通過する。
Then, the spectacle lens L is set on the upper side (inspection position) of each hook 21. The optical axis of the spectacle lens L faces in the vertical direction, and is arranged so that the convex surface is on the bottom when the spectacle lens L is a convex lens, and the concave surface is on the top when the spectacle lens L is a concave lens. Be placed. Since the narrow-angle light irradiating means 7 has each narrow-angle light LED 24 and each illuminating lens 26 arranged over the entire circumferential direction, it illuminates the entire periphery of the spectacle lens L. The orientation of the spectacle lens L may be opposite to that described above, but the orientation described above facilitates more appropriate imaging of the scattered light of each lens.
The substantially narrow-angle light emitted from each narrow-angle light LED 24 is parallel to the direction of the narrow-angle light LED 24, becomes narrow-angle light by the corresponding illumination lens 26, and becomes large toward the spectacle lens L. It goes almost straight without spreading or suddenly focusing. The direction of the narrow-angle light emitted from each illuminating lens 26 is a direction intersecting the optical axis of the spectacle lens L, and more specifically, a direction orthogonal to or oblique to the optical axis. The light emitting portion of each narrow-angle light LED 24 has a predetermined size (for example, a disk having a diameter of 2 mm (millimeter)), and in the traveling direction related to the narrow-angle light from each narrow-angle light LED 24 or the illumination lens 26. The size of the vertical cross section increases by the amount of the directional angle from the size of the light emitting part.
Even when the narrow-angle light reaches the lens holding mechanism 6, at least the reaching portion (the standing portion of each hook 21) has translucency, so that the narrow-angle light passes through the lens holding mechanism 6.

カメラ8は、エンクロージャ2の内側の上部に設置される。
カメラ8は、カメラ本体34と、カメラレンズ36と、を備えている。
カメラ本体34は、撮像素子30及び記憶手段32を有する。
カメラレンズ36は、カメラ本体34の下部に取り付けられている。
カメラ8は、制御手段12からの指令に基づき、カメラレンズ36から取り込まれた像を撮像素子30で撮像することで第1〜第4検査用画像C1〜C4を取得して、記憶手段32に記憶し、制御手段12に送信する。撮像素子30は、ここではエリアセンサである。
撮像素子30及びカメラレンズ36は、眼鏡レンズLと向かい合うように設置されている。
尚、カメラ8は、記憶手段32を具備せず、第1〜第4検査用画像C1〜C4を直ちに制御手段12に送信しても良い。又、記憶手段32は、揮発性であっても不揮発性であっても良く、メモリであってもハードディスクであってもあるいはこれらの組合せであっても良い。
The camera 8 is installed in the upper part inside the enclosure 2.
The camera 8 includes a camera body 34 and a camera lens 36.
The camera body 34 has an image sensor 30 and a storage means 32.
The camera lens 36 is attached to the lower part of the camera body 34.
Based on the command from the control means 12, the camera 8 acquires the first to fourth inspection images C1 to C4 by capturing the image captured from the camera lens 36 with the image sensor 30, and stores the images C1 to C4 in the storage means 32. It is stored and transmitted to the control means 12. The image sensor 30 is an area sensor here.
The image sensor 30 and the camera lens 36 are installed so as to face the spectacle lens L.
The camera 8 may not include the storage means 32, and may immediately transmit the first to fourth inspection images C1 to C4 to the control means 12. Further, the storage means 32 may be volatile or non-volatile, and may be a memory, a hard disk, or a combination thereof.

撮像素子30は、狭角光のみによる撮像であることを考慮して、比較的に高い解像度を有するものとされている。又、撮像素子30は、狭角光のみによる撮像であることを考慮して、比較的に高い感度を有するものとされている。
又、カメラレンズ36は、物体側の主光線がレンズ光軸に対して平行である物体側テレセントリックレンズである。尚、カメラレンズ36は、物体側と像側の双方において主光線がレンズ光軸に対して平行である両側テレセントリックレンズであっても良い。
カメラレンズ36は、物体側テレセントリックレンズであるため、被写界深度が比較的に深く、カーブが深かったり厚さが大きかったりする眼鏡レンズLにおいても、被写界深度はその眼鏡レンズLの全体においてピントが合うものとなっている。
カメラレンズ36の実視野は、狭角光のみによる撮像であること、及び眼鏡レンズL全体を捉えることを考慮して、比較的に広いものされており、好ましくは85mm以上とされている。
The image pickup device 30 is considered to have a relatively high resolution in consideration of the fact that the image pickup is performed only by narrow-angle light. Further, the image pickup device 30 is considered to have a relatively high sensitivity in consideration of the fact that the image pickup is performed only by narrow-angle light.
Further, the camera lens 36 is an object-side telecentric lens in which the main ray on the object-side is parallel to the optical axis of the lens. The camera lens 36 may be a bilateral telecentric lens in which the main ray is parallel to the optical axis of the lens on both the object side and the image side.
Since the camera lens 36 is an object-side telecentric lens, even in a spectacle lens L having a relatively deep depth of field and a deep curve or a large thickness, the depth of field is the entire spectacle lens L. Is in focus.
The actual field of view of the camera lens 36 is relatively wide, preferably 85 mm or more, in consideration of the fact that the image is taken only by narrow-angle light and that the entire spectacle lens L is captured.

報知手段9は、少なくとも検査結果を報知するものであり、例えば音発生手段、若しくは表示手段、又はこれらの組合せである。音発生手段は、例えばスピーカー又はブザーであり、表示手段は、例えばランプ、7セグメントLED、フラットディスプレイ、あるいはこれらの組合せである。表示手段は、タッチパネルを始めとする、入力手段と組み合わせられたものであっても良い。又、独立した入力手段(例えばキーボード、ポインティングデバイス、あるいはこれらの組合せ)が設けられても良い。 The notification means 9 notifies at least the inspection result, and is, for example, a sound generating means, a display means, or a combination thereof. The sound generating means is, for example, a speaker or a buzzer, and the display means is, for example, a lamp, a 7-segment LED, a flat display, or a combination thereof. The display means may be a combination with an input means such as a touch panel. Further, an independent input means (for example, a keyboard, a pointing device, or a combination thereof) may be provided.

制御手段12は、例えばエンクロージャ2外に配置されあるいはエンクロージャ2に付設されたマイクロコンピュータであり、リフト20、狭角光照射手段7、カメラ8ないし報知手段9とそれぞれ電気的に接続されていて、これらをそれぞれ制御する。尚、制御手段12は、リフト20、狭角光照射手段7、カメラ8ないし報知手段9の少なくとも何れかに組み込まれていても良いし、協調制御可能に複数分散されていても良い。
又、制御手段12には、眼鏡レンズLを検査位置に置いたり検査位置から取り出したりする搬送手段(図示略)が電気的に接続されており、制御手段12は、搬送手段を制御可能である。搬送手段は、例えば(ノズル移動手段と共通のあるいは別の)ロボットハンド、コンベア、若しくは眼鏡レンズLのリフト、あるいはこれらの組合せである。コンベアの場合、狭角光照射手段7について退避動作(例えば上昇)ないし復帰動作(下降)を可能とし、制御手段12は、狭角光照射手段7を退避させてコンベアにより眼鏡レンズLを検査位置に搬入し、その後狭角光照射手段7を復帰させても良い。眼鏡レンズLのリフトの場合、眼鏡レンズL載置部の退避(下降)位置で眼鏡レンズLが載置された後、当該載置部が検査位置に復帰(上昇)し、検査後に退避位置で眼鏡レンズLが取り出されても良い。尚、搬送手段は、眼鏡レンズLとレンズ保持機構6を搬送しても良い。又、レンズ外観検査装置1は、レンズ洗浄装置と組み合わせられて良く、この場合に搬送手段がレンズ洗浄装置に眼鏡レンズLを搬送し、眼鏡レンズLが洗浄されてから、眼鏡レンズLを取り出してレンズ外観検査装置1に搬送しても良い。
The control means 12 is, for example, a microcomputer arranged outside the enclosure 2 or attached to the enclosure 2, and is electrically connected to the lift 20, the narrow-angle light irradiation means 7, the camera 8 or the notification means 9, respectively. Each of these is controlled. The control means 12 may be incorporated in at least one of the lift 20, the narrow-angle light irradiation means 7, the camera 8 and the notification means 9, or may be dispersed in a plurality of pieces so as to be cooperatively controllable.
Further, the control means 12 is electrically connected to a transport means (not shown) for placing the spectacle lens L at the inspection position or taking it out from the inspection position, and the control means 12 can control the transport means. .. The transport means is, for example, a robot hand (common or different from the nozzle moving means), a conveyor, a lift of the spectacle lens L, or a combination thereof. In the case of a conveyor, the narrow-angle light irradiating means 7 can be retracted (for example, raised) or returned (lowered), and the control means 12 retracts the narrow-angle light irradiating means 7 and inspects the spectacle lens L by the conveyor. Then, the narrow-angle light irradiation means 7 may be restored. In the case of a lift of the spectacle lens L, after the spectacle lens L is mounted at the retracted (lowered) position of the spectacle lens L mounting portion, the mounted portion returns (rises) to the inspection position and at the retracted position after the inspection. The spectacle lens L may be taken out. The transport means may transport the spectacle lens L and the lens holding mechanism 6. Further, the lens appearance inspection device 1 may be combined with a lens cleaning device. In this case, the transporting means transports the spectacle lens L to the lens cleaning device, and after the spectacle lens L is cleaned, the spectacle lens L is taken out. It may be conveyed to the lens appearance inspection device 1.

又、制御手段12は、カメラ8の記憶手段32と同様である記憶手段40と、通信手段42と、これらを制御するCPU44と、を備えている。 Further, the control means 12 includes a storage means 40 similar to the storage means 32 of the camera 8, a communication means 42, and a CPU 44 that controls them.

記憶手段40には、レンズ外観検査プログラム50と、レンズデータベース52と、機械学習手段としての機械学習プログラム54と、第1〜第4検査用画像C1〜C4と、第1〜第4検査用マスク画像D1〜D4と、検査用合成画像Eとが記憶されている。 The storage means 40 includes a lens appearance inspection program 50, a lens database 52, a machine learning program 54 as a machine learning means, images C1 to C4 for the first to fourth inspections, and masks for the first to fourth inspections. Images D1 to D4 and composite images E for inspection are stored.

レンズ外観検査プログラム50は、CPU44によって実行され、図3に示されるレンズ外観検査処理を含んでいる。 The lens appearance inspection program 50 is executed by the CPU 44 and includes the lens appearance inspection process shown in FIG.

レンズデータベース52は、眼鏡レンズLの種類に応じて一意に付与されるレンズIDに対し、カメラ8による撮像に関する各種の設定値であるカメラ設定値と、撮像時の照明に関する各種の設定値である照明設定値とを対応付けたものである。レンズIDは、レンズ特性値に基づいて付与される。レンズデータベース52は、レンズ特性値を、レンズIDに対応付けて記憶している。尚、レンズ特性値の何れかがレンズIDとみなされても良い。
レンズ特性値は、ここでは眼鏡レンズLの直径、カーブ値(度数)、レンズ設計情報(眼鏡レンズLの直径,床高,中心厚,コバ厚)、及びコーティングの種類を示す値である。床高は、眼鏡レンズLの凸面を上あるいは凹面を下にして平面においたときの当該平面から凸面(凹面の逆側の面)最上部までの高さであり、中心厚は、眼鏡レンズLの中心における厚みであり、コバ厚は、眼鏡レンズLのコバ(縁)における厚みである。尚、レンズ特性値のうち、任意の一部の値が省略されても良いし、他の値が加えられても良い。又、各種のレンズ特性値は、直接入力を受け付けても良いし、他のレンズ特性値から計算により算出されても良い。
一方、カメラ設定値は、ここでは眼鏡レンズLとカメラレンズ36の間の距離である撮像距離、露光時間、及びゲインである。尚、カメラ設定値のうち、任意の一部の値が省略されても良いし、他の値が加えられても良い。
他方、照明設定値は、ここでは全照射ユニット23の角度(全傾斜角調節手段27の角度)である照明角度θ、及び全照射ユニット23の眼鏡レンズLからの鉛直方向の距離である照明高さhである。照明角度θの取り方は、どのようなものであっても良いところ、ここでは単位が°とされ、正負が水平方向から下向きに正の値、上向きに負の値をとるものとされる。又、照明高さhの取り方は、どのようなものであっても良いところ、ここではベース22のレール25に沿った上下移動のうちの最下位置のときにh=0とされ、この位置から所定単位距離だけ上昇したときにh=1とされる。尚、照明設定値のうち、任意の一部の値が省略されても良いし、強度(明るさ)、色度等の他の値が加えられても良い。
以下、レンズ特性値の具体的な値の一揃いがレンズ条件と呼ばれ、カメラ設定値の具体的な値の一揃いがカメラ条件と呼ばれ、照明設定値の具体的な値の一揃いが照明条件と呼ばれることがある。又、レンズ条件、カメラ条件及び照明条件の少なくとも何れかについて、検査条件と呼ばれることがある。
The lens database 52 is a camera setting value which is various setting values related to imaging by the camera 8 and various setting values related to lighting at the time of imaging for a lens ID uniquely assigned according to the type of the spectacle lens L. It is associated with the lighting set value. The lens ID is assigned based on the lens characteristic value. The lens database 52 stores the lens characteristic value in association with the lens ID. Any one of the lens characteristic values may be regarded as the lens ID.
Here, the lens characteristic value is a value indicating the diameter of the spectacle lens L, the curve value (power), the lens design information (diameter of the spectacle lens L, floor height, center thickness, edge thickness), and the type of coating. The floor height is the height from the flat surface to the uppermost part of the convex surface (the surface opposite to the concave surface) when the convex surface of the spectacle lens L is placed on a flat surface with the convex surface up or the concave surface down, and the center thickness is the spectacle lens L. The edge thickness is the thickness at the edge of the spectacle lens L. Of the lens characteristic values, any arbitrary value may be omitted, or other values may be added. Further, various lens characteristic values may be directly input or calculated from other lens characteristic values.
On the other hand, the camera set values here are the imaging distance, the exposure time, and the gain, which are the distances between the spectacle lens L and the camera lens 36. Of the camera setting values, any part of the values may be omitted, or other values may be added.
On the other hand, the illumination set values are the illumination angle θ, which is the angle of the total irradiation unit 23 (the angle of the total tilt angle adjusting means 27), and the illumination height, which is the distance of the total irradiation unit 23 from the spectacle lens L in the vertical direction. It is h. The illumination angle θ may be taken in any way, but here, the unit is °, and the positive and negative values are taken from the horizontal direction to the downward positive value and upward to the negative value. Further, the illumination height h may be set in any way, but here, h = 0 is set at the lowest position of the vertical movement along the rail 25 of the base 22. When the height is increased by a predetermined unit distance from the position, h = 1. Of the lighting setting values, any arbitrary value may be omitted, or other values such as intensity (brightness) and chromaticity may be added.
Hereinafter, a set of specific values of lens characteristic values is called a lens condition, a set of specific values of camera setting values is called a camera condition, and a set of specific values of lighting setting values is called a camera condition. Sometimes called lighting conditions. Further, at least one of the lens condition, the camera condition and the illumination condition may be referred to as an inspection condition.

第1〜第4検査用画像C1〜C4は、図4で示されるように、第1〜第4照明部分M1〜M4の点灯時に、カメラ8により取得されるものである。第1〜第4検査用画像C1〜C4の形状は、正方形である。第1〜第4検査用画像C1〜C4は、それぞれ眼鏡レンズLの画像を含んでいる。以下、眼鏡レンズL自体だけでなく、その画像(画像処理後のものも含む)も、適宜眼鏡レンズLと呼ばれる。尚、第1〜第4検査用画像C1〜C4の形状は、正方形に限られない。
又、第1〜第4検査用マスク画像D1〜D4は、第1〜第4検査用画像C1〜C4における照明の映り込みR1〜R4を含む第1〜第4画像部分N1〜N4をマスク(消去)して生成される。検査対象レンズがマイナスレンズの場合、右上,右下,左下,左上の第1〜第4画像部分N1〜N4への映り込みR1〜R4の出現は、順に第1〜第4照明部分M1〜M4の点灯時であり、検査対象レンズがプラスレンズの場合、右上〜左上の第1〜第4画像部分N1〜N4への映り込みR1〜R4の出現は、順に第3,第4,第1,第2照明部分M3,M4,M1,M2の点灯時である。
更に、検査用合成画像Eは、第1〜第4検査用マスク画像D1〜D4を合成して生成される。
As shown in FIG. 4, the first to fourth inspection images C1 to C4 are acquired by the camera 8 when the first to fourth illumination portions M1 to M4 are lit. The shapes of the first to fourth inspection images C1 to C4 are square. The first to fourth inspection images C1 to C4 include images of the spectacle lens L, respectively. Hereinafter, not only the spectacle lens L itself but also the image thereof (including the one after image processing) is appropriately referred to as the spectacle lens L. The shapes of the first to fourth inspection images C1 to C4 are not limited to squares.
Further, the first to fourth inspection mask images D1 to D4 mask the first to fourth image portions N1 to N4 including the illumination reflections R1 to R4 in the first to fourth inspection images C1 to C4. Erase) and generate. When the lens to be inspected is a minus lens, the reflections R1 to R4 on the first to fourth image parts N1 to N4 on the upper right, lower right, lower left, and upper left appear in order from the first to fourth illumination parts M1 to M4. When the lens to be inspected is a plus lens, the reflections R1 to R4 on the first to fourth image parts N1 to N4 on the upper right to the upper left appear in the third, fourth, and first order in order. This is when the second lighting portions M3, M4, M1 and M2 are lit.
Further, the inspection composite image E is generated by synthesizing the first to fourth inspection mask images D1 to D4.

通信手段42は、各種の情報を入出力可能な手段であり、例えばハブ、各種の端子、通信コントローラ、あるいはこれらの組合せである。
尚、内側形状を調整可能なレンズ保持機構6が制御手段12に接続される場合において、制御手段12がレンズ特性値(眼鏡レンズLの直径)に応じてレンズ保持機構6の内側形状を制御するようにしても良い。
The communication means 42 is a means capable of inputting and outputting various types of information, and is, for example, a hub, various terminals, a communication controller, or a combination thereof.
When the lens holding mechanism 6 whose inner shape can be adjusted is connected to the control means 12, the control means 12 controls the inner shape of the lens holding mechanism 6 according to the lens characteristic value (diameter of the spectacle lens L). You may do so.

更に、レンズ外観検査プログラム50は、第1〜第4検査用画像C1〜C4の何れか1枚に対して画像処理を行う単画像処理、及び複数の画像に対して画像処理を行う複画像処理を含んでいる。 Further, the lens appearance inspection program 50 includes a single image processing that performs image processing on any one of the first to fourth inspection images C1 to C4, and a compound image processing that performs image processing on a plurality of images. Includes.

単画像処理は、第1検査用画像C1の右上部分である第1画像部分N1,第2検査用画像C2の右下部分である第2画像部分N2,第3検査用画像C3の左下部分である第3画像部分N3あるいは第4検査用画像C4の左上部分である第4画像部分N4の何れかを消去して第1検査用マスク画像D1,第2検査用マスク画像D2,第3検査用マスク画像D3,第4検査用マスク画像D4を生成する一部消去処理を含んでいる。
ここで、消去(マスク)は、消去対象部分を所定の背景色(例えば黒色)とするものである。消去対象部分としての第1〜第4画像部分N1〜N4は、第1〜第4検査用マスク画像D1〜D4の中心から発する放射方向の直線(縦中心線及び横中心線)によって区分されており、それぞれ、第1〜第4検査用画像C1〜C4の丁度4分の1の大きさを有している。第1〜第4検査用マスク画像D1〜D4の中心は、第1〜第4検査用画像C1〜C4の中心と合致し、第1〜第4検査用画像C1〜C4の中心は、眼鏡レンズLの中心(狭角光照射手段7内の検査位置の中心)に合わせられるところ、ずれていても良く、これら中心がずれている場合に、第1〜第4画像部分N1〜N4を画する放射方向の直線は、第1〜第4検査用マスク画像D1〜D4上の眼鏡レンズLの中心(狭角光照射手段7内の検査位置の中心)から発せられるようにしても良い。
尚、第1〜第4検査用画像C1〜C4及び第1〜第4検査用マスク画像D1〜D4は、ここでは縦画素数が横画素数と同一の正方形であるところ、縦画素数が横画素数と異なる長方形であっても良い。又、消去(マスク)は、対象部分を、背景色とは異なる所定のマスク色(例えば暗い灰色)に塗り潰すものであっても良いし、後述の合成処理の対象にならない旨の情報である非合成対象情報を対象部分に埋め込むものであっても良い。
The single image processing is performed on the first image portion N1, which is the upper right portion of the first inspection image C1, the second image portion N2, which is the lower right portion of the second inspection image C2, and the lower left portion of the third inspection image C3. By erasing either the third image portion N3 or the fourth image portion N4 which is the upper left portion of the fourth inspection image C4, the first inspection mask image D1, the second inspection mask image D2, and the third inspection It includes a partial erasing process for generating the mask image D3 and the fourth inspection mask image D4.
Here, the erasing (mask) sets the erasing target portion as a predetermined background color (for example, black). The first to fourth image parts N1 to N4 as the parts to be erased are classified by straight lines (vertical center line and horizontal center line) in the radial direction emanating from the center of the first to fourth inspection mask images D1 to D4. Each has exactly one-fourth the size of the first to fourth inspection images C1 to C4. The centers of the first to fourth inspection mask images D1 to D4 coincide with the centers of the first to fourth inspection images C1 to C4, and the centers of the first to fourth inspection images C1 to C4 are spectacle lenses. The center of L (the center of the inspection position in the narrow-angle light irradiation means 7) may be deviated, and when these centers are deviated, the first to fourth image portions N1 to N4 are drawn. The straight line in the radial direction may be emitted from the center of the spectacle lenses L (the center of the inspection position in the narrow-angle light irradiation means 7) on the first to fourth inspection mask images D1 to D4.
The first to fourth inspection images C1 to C4 and the first to fourth inspection mask images D1 to D4 have a square shape in which the number of vertical pixels is the same as the number of horizontal pixels, but the number of vertical pixels is horizontal. It may be a rectangle different from the number of pixels. Further, the erasure (mask) may be a mask that fills the target portion with a predetermined mask color (for example, dark gray) different from the background color, and is information that the target portion is not subject to the composition processing described later. The non-synthesized target information may be embedded in the target portion.

複画像処理は、一部消去処理が施された第1〜第4検査用マスク画像D1〜D4の画素情報を平均化して検査用合成画像Eを生成する合成処理を含んでいる。
ここで、合成処理においては、第1画像部分N1,第2画像部分N2,第3画像部分N3,第4画像部分N4が消去された合計4枚の第1〜第4検査用マスク画像D1〜D4を対象とする。対象となる第1〜第4検査用マスク画像D1〜D4の縦横の画素数は、互いに同一である。
そして、それら4枚の第1〜第4検査用マスク画像D1〜D4について、対応する画素位置(例えば縦位置と横位置の組合せ)の画素値(例えば256段階の輝度)が合計され、その合計値を3で割ることで平均化される。3で割るのは、第1〜第4検査用マスク画像D1〜D4において第1画像部分N1,第2画像部分N2,第3画像部分N3あるいは第4画像部分N4の何れかが消去されており、第1〜第4検査用マスク画像D1〜D4の合計において1度消去部分(マスク部分)が加味されるので、その分合計枚数から引く(4−1=3)からである。第1画像部分N1,第2画像部分N2,第3画像部分N3及び第4画像部分N4は、第1〜第4検査用マスク画像D1〜D4を重ね合わせた場合に、互いに重複せず、第1検査用マスク画像D1等と丁度同じ大きさをカバーする。
尚、第1〜第4画像部分N1〜N4の少なくとも一部は、互いに重複しても良く、この場合、重複部分に対して更なる平均化等の追加の処理を施しても良い。又、第1〜第4検査用画像C1〜C4及び第1〜第4検査用マスク画像D1〜D4の少なくとも何れかの画素値は、赤緑青(RGB)の各輝度値等であっても良い。又更に、検査用合成画像Eは、平均化した輝度ではなく、合計値の輝度を有していても良い。更に、合成処理の対象となる第1〜第4検査用マスク画像D1〜D4は、狭角光照射手段7の分割数(狭角光LED24,24・・の分割数)に応じて増減されても良いし、その分割数が4である場合に8枚とされる等、分割数より多い枚数とされても良い。加えて、単画像処理及び複画像処理の少なくとも一方には、2値化処理及びノイズリダクション処理の少なくとも一方等の他の処理が含まれていても良い。又、施した処理の種類又は組合せ毎に、画像が別々に保存されても良い。
The compound image processing includes a compositing process of averaging the pixel information of the first to fourth inspection mask images D1 to D4 that have been partially erased to generate an inspection composite image E.
Here, in the compositing process, a total of four mask images D1 to 4 for inspection in which the first image portion N1, the second image portion N2, the third image portion N3, and the fourth image portion N4 are erased are erased. Targets D4. The number of vertical and horizontal pixels of the target first to fourth inspection mask images D1 to D4 is the same as each other.
Then, for the four first to fourth inspection mask images D1 to D4, the pixel values (for example, 256 levels of brightness) of the corresponding pixel positions (for example, a combination of the vertical position and the horizontal position) are totaled, and the total thereof is obtained. It is averaged by dividing the value by 3. Dividing by 3 means that in the first to fourth inspection mask images D1 to D4, either the first image portion N1, the second image portion N2, the third image portion N3, or the fourth image portion N4 is erased. , Since the erased portion (mask portion) is added once in the total of the first to fourth inspection mask images D1 to D4, it is subtracted from the total number of images (4-1 = 3). The first image portion N1, the second image portion N2, the third image portion N3, and the fourth image portion N4 do not overlap each other when the first to fourth inspection mask images D1 to D4 are overlapped with each other. 1 Mask for inspection Covers exactly the same size as the image D1 and the like.
At least a part of the first to fourth image portions N1 to N4 may overlap each other, and in this case, the overlapping portion may be subjected to additional processing such as further averaging. Further, at least one of the pixel values of the first to fourth inspection images C1 to C4 and the first to fourth inspection mask images D1 to D4 may be the respective luminance values of red, green, and blue (RGB). .. Furthermore, the composite image E for inspection may have a total brightness instead of the averaged brightness. Further, the first to fourth inspection mask images D1 to D4 to be combined are increased or decreased according to the number of divisions of the narrow angle light irradiation means 7 (the number of divisions of the narrow angle light LEDs 24, 24 ...). Alternatively, the number may be larger than the number of divisions, such as 8 when the number of divisions is 4. In addition, at least one of the single image processing and the double image processing may include other processing such as at least one of the binarization processing and the noise reduction processing. In addition, images may be stored separately for each type or combination of treatments performed.

機械学習プログラム54は、CPU44での実行により、制御手段12を機械学習器(エージェント)とする。機械学習プログラム54を実行した制御手段12が、機械学習手段あるいは機械学習装置と捉えられても良い。尚、機械学習プログラム54(機械学習器)は、制御手段12と別体のハードウェアにおいて実行(構成)されても良い。
図5に示されるように、機械学習プログラム54は、状態観測部60と、学習部62と、意思決定部64と、を有している。
機械学習プログラム54は、図6に示される機械学習処理を含んでいる。
The machine learning program 54 uses the control means 12 as a machine learning device (agent) by being executed by the CPU 44. The control means 12 that executes the machine learning program 54 may be regarded as a machine learning means or a machine learning device. The machine learning program 54 (machine learning device) may be executed (configured) in hardware separate from the control means 12.
As shown in FIG. 5, the machine learning program 54 includes a state observation unit 60, a learning unit 62, and a decision-making unit 64.
The machine learning program 54 includes the machine learning process shown in FIG.

状態観測部60は、照明条件マトリクスLMを有している。
状態観測部60は、状態変数として、照明高さh及び照明角度θを観測する。又、状態観測部60は、状態変数に対応する環境状態として、検査用合成画像Eを観測し、より詳しくは検査用合成画像Eにおける異常判定の状態を観測する。
状態観測部60は、照明高さh及び照明角度θ並びに検査用合成画像Eを、レンズ外観検査プログラム50から取得して、照明条件マトリクスLMにおいて記憶する。
照明条件マトリクスLMは、行及び列として照明高さh及び照明角度θを有し、行と列とが定められた格子において、照明高さh及び照明角度θに対応する検査用合成画像Eを有する。
The state observation unit 60 has an illumination condition matrix LM.
The state observing unit 60 observes the illumination height h and the illumination angle θ as state variables. Further, the state observing unit 60 observes the inspection composite image E as the environmental state corresponding to the state variable, and more specifically, observes the state of abnormality determination in the inspection composite image E.
The state observation unit 60 acquires the illumination height h, the illumination angle θ, and the composite image E for inspection from the lens appearance inspection program 50 and stores them in the illumination condition matrix LM.
The illumination condition matrix LM has an illumination height h and an illumination angle θ as rows and columns, and in a grid in which rows and columns are defined, a composite image E for inspection corresponding to the illumination height h and the illumination angle θ is displayed. Have.

学習部62は、報酬条件設定部70と、報酬計算部72と、関数更新部74(人工知能)と、学習結果記憶部76と、を有する。
学習部62は、状態観測部60により観測された照明高さh及び照明角度θの少なくとも一方の変化と、検査用合成画像Eによる異物等の発見状況とを関連付けて学習する。
学習部62は、ここではQ学習(Q−learning)により強化学習を行う。
尚、学習部62は、Q学習以外の強化学習を行っても良いし、その他の機械学習、例えば教師あり学習、教師なし学習、半教師あり学習、トランスダクション、マルチタスク学習を行っても良い。
The learning unit 62 includes a reward condition setting unit 70, a reward calculation unit 72, a function update unit 74 (artificial intelligence), and a learning result storage unit 76.
The learning unit 62 learns by associating at least one change of the illumination height h and the illumination angle θ observed by the state observation unit 60 with the state of finding foreign matter or the like by the composite image E for inspection.
Here, the learning unit 62 performs reinforcement learning by Q-learning.
The learning unit 62 may perform enhanced learning other than Q learning, or may perform other machine learning, such as supervised learning, unsupervised learning, semi-supervised learning, translation, and multitasking learning. ..

報酬条件設定部70は、Q学習における報酬条件を設定する。
報酬計算部72は、状態観測部60により観測された照明高さh及び照明角度θの少なくとも一方並びに検査用合成画像Eの異常判定状態と、報酬条件に基づいて、報酬を計算する。
関数更新部74は、報酬計算部72により計算された報酬に基づいて、現在の状態変数から、次の照明条件を決定する関数、例えば行動価値関数(行動価値テーブル)を更新する。尚、関数更新部74は、他の関数を更新しても良い。
学習結果記憶部76は、関数更新部74が学習した結果を記憶する。
The reward condition setting unit 70 sets the reward condition in Q-learning.
The reward calculation unit 72 calculates the reward based on at least one of the illumination height h and the illumination angle θ observed by the state observation unit 60, the abnormality determination state of the inspection composite image E, and the reward condition.
The function update unit 74 updates a function for determining the next lighting condition, for example, an action value function (action value table) from the current state variable, based on the reward calculated by the reward calculation unit 72. The function update unit 74 may update another function.
The learning result storage unit 76 stores the result learned by the function update unit 74.

報酬条件設定部70により設定される報酬条件は、ここでは照明高さh及び照明角度θ並びに検査用合成画像Eに応じて定まる。
例えば、照明条件として、照明高さhが第1の値の照明高さh1であり、照明角度θが第1の値の照明角度θ1である条件で取得された検査用合成画像Eを、検査用合成画像E11とした場合(照明条件マトリクスLM参照)、検査用合成画像E11に特定値以上の輝度を有する画素が特定範囲以上に亘り存在して異物等が見つからなければ(異常判定の状態の一つ)、報酬が減る。他方、検査用合成画像E11にそのような異物等が見つかれば(異常判定の状態の他の一つ)、報酬が増える。ここでの輝度に係る特定値は、レンズ外観検査における異常発生判定(異常判定でのYESとの判定)時の所定値と同一であるところ、当該所定値と異なっていても良い。又、特定範囲は、レンズ外観検査における異常発生判定時の所定範囲より大きいところ、当該所定範囲と同一であっても良いし、当該所定範囲より小さくても良い。
同様に、照明高さh1,照明角度θ2の検査用合成画像E12において、特定輝度及び特定範囲に係る異物等が見つからなければ、報酬が減り、そうでなければ、報酬が増える。
更に同様に、照明高さh2,照明角度θ1の検査用合成画像E21において、特定輝度及び特定範囲に係る異物等が見つからなければ、報酬が減り、そうでなければ、報酬が増える。
又更に同様に、照明高さh2,照明角度θ2の検査用合成画像E22において、特定輝度及び特定範囲に係る異物等が見つからなければ、報酬が減り、そうでなければ、報酬が増える。
同様に、他の照明条件に係る検査用合成画像Eについても、異物等が見つからなければ、報酬が減り、そうでなければ、報酬が増える。
The reward condition set by the reward condition setting unit 70 is determined here according to the illumination height h, the illumination angle θ, and the composite image E for inspection.
For example, as an illumination condition, an inspection composite image E acquired under the condition that the illumination height h is the illumination height h1 of the first value and the illumination angle θ is the illumination angle θ1 of the first value is inspected. In the case of the composite image E11 for inspection (see the illumination condition matrix LM), if the composite image E11 for inspection has pixels having a brightness equal to or higher than a specific value over a specific range and no foreign matter or the like is found (in the state of abnormality determination). One), the reward is reduced. On the other hand, if such a foreign substance or the like is found in the inspection composite image E11 (another one in the abnormal determination state), the reward increases. The specific value related to the brightness here is the same as the predetermined value at the time of abnormality occurrence determination (determination of YES in the abnormality determination) in the lens appearance inspection, but may be different from the predetermined value. Further, the specific range may be the same as the predetermined range or smaller than the predetermined range where the specific range is larger than the predetermined range at the time of determining the occurrence of abnormality in the lens appearance inspection.
Similarly, in the inspection composite image E12 having the illumination height h1 and the illumination angle θ2, if no foreign matter or the like related to the specific brightness and the specific range is found, the reward is reduced, and if not, the reward is increased.
Similarly, in the inspection composite image E21 having the illumination height h2 and the illumination angle θ1, if no foreign matter or the like related to the specific brightness and the specific range is found, the reward is reduced, and if not, the reward is increased.
Similarly, if no foreign matter or the like related to the specific brightness and the specific range is found in the inspection composite image E22 having the illumination height h2 and the illumination angle θ2, the reward decreases, and if not, the reward increases.
Similarly, for the inspection composite image E related to other lighting conditions, if no foreign matter or the like is found, the reward decreases, and if not, the reward increases.

図7は、所定のマイナスレンズを検査対象として報酬が増える場合の検査用合成画像Eの例を示すものであり、図8は、図7の一部拡大図である。又、図9は、そのマイナスレンズを検査対象として報酬が増えない場合の検査用合成画像Eの例を示すものであり、図10は、図9の一部拡大図である。図7〜図10における検査用合成画像Eは、何れも白黒反転処理を施したものである。
制御手段12は、図7及び図8の場合、特定輝度及び特定範囲に係る異物等が存在するため、報酬計算部72により当該照明条件における報酬を増やす。尚、図7及び図8では、異物等を分かり易くするため、異物等を囲む手書きの丸印が付されている。ここでは、この丸印は、学習に反映されないようにしている。かような丸印については、以下同様である。
一方、制御手段12は、図9及び図10の場合、異物等が存在するものの、特定輝度及び特定範囲に至っていないため、報酬計算部72において当該照明条件における報酬を増やさない。
他方、図11〜図14は、順に所定のプラスレンズを検査対象とした場合の図7〜図10同様図である。図11〜図14における検査用合成画像Eは、何れも白黒反転処理を施したものである。
プラスレンズにおいても、特定の異物等の有無に応じ、その照明条件における報酬が同様に計算される。
尚、図7〜図14における少なくとも何れかの検査用合成画像Eに対する白黒反転処理は、省略されても良い。更に、図7,図8,図11,図12の場合に比較的大きい値の報酬が与えられ、図9,図10,図13,図14の場合に比較的小さい値の報酬が与えられても良い。又、異物等に相当する画素の輝度及び範囲の少なくとも一方の大きさに基づいて、付与される報酬が段階的にあるいは連続的に変化しても良い。即ち、報酬は、画素の輝度及び範囲の少なくとも一方の、段階的あるいは連続的な関数になっていても良い。
FIG. 7 shows an example of a composite image E for inspection when a predetermined minus lens is used as an inspection target and the reward is increased, and FIG. 8 is a partially enlarged view of FIG. 7. Further, FIG. 9 shows an example of a composite image E for inspection when the minus lens is the inspection target and the reward does not increase, and FIG. 10 is a partially enlarged view of FIG. The composite images E for inspection in FIGS. 7 to 10 are all subjected to black-and-white inversion processing.
In the case of FIGS. 7 and 8, the control means 12 increases the reward under the lighting condition by the reward calculation unit 72 because foreign matter and the like related to the specific brightness and the specific range are present. In addition, in FIGS. 7 and 8, in order to make it easy to understand the foreign matter and the like, a handwritten circle surrounding the foreign matter and the like is attached. Here, this circle is not reflected in learning. The same applies to such circles.
On the other hand, in the case of FIGS. 9 and 10, the control means 12 does not increase the reward under the lighting conditions in the reward calculation unit 72 because the foreign matter and the like are present but the specific brightness and the specific range have not been reached.
On the other hand, FIGS. 11 to 14 are the same views as those in FIGS. 7 to 10 when predetermined plus lenses are sequentially targeted for inspection. The composite images E for inspection in FIGS. 11 to 14 are all subjected to black-and-white inversion processing.
In the case of a plus lens, the reward under the lighting conditions is calculated in the same manner depending on the presence or absence of a specific foreign substance or the like.
The black-and-white inversion process for at least any of the inspection composite images E in FIGS. 7 to 14 may be omitted. Further, in the cases of FIGS. 7, 8, 11, and 12, a relatively large reward is given, and in the cases of 9, 9, 10, 13, and 14, a relatively small reward is given. Is also good. Further, the reward to be given may be changed stepwise or continuously based on the brightness of the pixel corresponding to a foreign substance or the like and the size of at least one of the ranges. That is, the reward may be a stepwise or continuous function of at least one of the brightness and range of the pixels.

意思決定部64は、現在の状態変数から、次の照明条件を決定する。
意思決定部64は、より良い行動の選択(意思決定)を学習するものである。
意思決定部64は、決定した照明条件を、レンズ外観検査プログラム50に通知(送信)可能である。レンズ外観検査プログラム50は、受信した照明条件における眼鏡レンズLの検査を実行可能である。
尚、意思決定部64は、レンズ外観検査プログラム50内に設けられていても良い。
The decision-making unit 64 determines the next lighting condition from the current state variable.
The decision-making unit 64 learns better action selection (decision-making).
The decision-making unit 64 can notify (transmit) the determined illumination condition to the lens appearance inspection program 50. The lens appearance inspection program 50 can perform an inspection of the spectacle lens L under the received illumination conditions.
The decision-making unit 64 may be provided in the lens appearance inspection program 50.

≪検査の動作等≫
このように成るレンズ外観検査装置1の動作例等が、主に図3に基づいて以下説明される。
レンズ外観検査装置1は、レンズ外観検査プログラム50を実行するCPU44(制御手段12)により、例えば次の通り動作する。
≪Inspection operation, etc.≫
An operation example of the lens appearance inspection device 1 as described above will be described below mainly based on FIG.
The lens appearance inspection device 1 is operated by the CPU 44 (control means 12) that executes the lens appearance inspection program 50, for example, as follows.

搬送手段は、制御手段12の制御により、検査対象の眼鏡レンズLを狭角光照射手段7内の検査位置に搬入する(ステップS1)。
制御手段12には、通信手段42を介して、搬入に係る眼鏡レンズLのレンズIDが入力される。レンズIDは、図示されない他のコンピュータから入力されても良いし、図示されない入力手段(例えばキーボード、ポインティングデバイス、タッチパネル、あるいはこれらの組合せ)により入力されても良い。又、レンズIDと共に、レンズ特性値の一部又は全部が入力されても良い。
エンクロージャ2には、図示されない扉が設けられており、眼鏡レンズLの搬入時にその扉は開けられて眼鏡レンズLを通過可能とされ、搬入完了後、撮像までに、その扉は閉じられて、エンクロージャ2による閉塞が確保される。
The transport means carries the spectacle lens L to be inspected to the inspection position in the narrow-angle light irradiation means 7 under the control of the control means 12 (step S1).
The lens ID of the spectacle lens L to be carried in is input to the control means 12 via the communication means 42. The lens ID may be input from another computer (not shown) or by an input means (for example, a keyboard, a pointing device, a touch panel, or a combination thereof) not shown. Further, a part or all of the lens characteristic values may be input together with the lens ID.
The enclosure 2 is provided with a door (not shown), which is opened when the spectacle lens L is carried in so that it can pass through the spectacle lens L. Blockage by the enclosure 2 is ensured.

制御手段12のCPU44は、レンズデータベース52を参照し、受信したレンズIDに対応するカメラ条件及び照明条件を取得して、そのカメラ条件(ステップS2)及び照明条件(ステップS3)に合致する撮像が行われるように、カメラ8及びリフト20並びに狭角光照射手段7に対して通信手段42を通じ指令を送る。 The CPU 44 of the control means 12 refers to the lens database 52, acquires the camera conditions and the illumination conditions corresponding to the received lens ID, and performs imaging that matches the camera conditions (step S2) and the illumination conditions (step S3). A command is sent to the camera 8, the lift 20, and the narrow-angle light irradiating means 7 through the communication means 42 so as to be performed.

カメラ条件に係るステップS2では、制御手段12は、レンズデータベース52で取得された撮像距離に合致するように、リフト20に対する指令を通じ、リフト20を作動させてステージ4を上昇させあるいは下降させ、天板3上の眼鏡レンズLを上昇させあるいは下降させることで、カメラレンズ36に対する眼鏡レンズLの位置を調整し、撮像距離を調整する。又、制御手段12は、カメラ8に対し、その他のカメラ設定値(露光時間,ゲイン)についてレンズデータベース52で取得されたものとなるように制御する。
尚、ステージ4が前後左右(水平方向)の少なくとも一方向に移動可能とされていても良い。又、カメラ8が上下動されあるいは水平移動されても良いし、カメラ8とステージ4の双方が上下動されあるいは水平移動されても良い。
In step S2 relating to the camera condition, the control means 12 operates the lift 20 to raise or lower the stage 4 through a command to the lift 20 so as to match the imaging distance acquired by the lens database 52, and raises or lowers the stage 4. By raising or lowering the spectacle lens L on the plate 3, the position of the spectacle lens L with respect to the camera lens 36 is adjusted, and the imaging distance is adjusted. Further, the control means 12 controls the camera 8 so that other camera setting values (exposure time, gain) are acquired by the lens database 52.
The stage 4 may be movable in at least one direction, front-back, left-right (horizontal direction). Further, the camera 8 may be moved up and down or horizontally, and both the camera 8 and the stage 4 may be moved up and down or horizontally.

更に、照明条件に係るステップS3では、制御手段12は、レンズデータベース52で取得された照明高さhに合致するように、ベース22に対する指令を通じ、ベース22を上昇させあるいは下降させることで、眼鏡レンズLに対する狭角光照射手段7の位置を調整し、照明高さhを調整する。又、制御手段12は、レンズデータベース52で取得された照明角度θに合致するように、各傾斜角調節手段27に対する指令を通じ、照射ユニット23を傾動させることで、眼鏡レンズLに対する狭角光照射手段7の角度を調整し、照明角度θを調整する。
尚、ベース22あるいは各照射ユニット23が、鉛直軸周りで回転移動可能とされていても良い。又、ベース22、あるいはベース22及び各照射ユニット23の双方が、水平軸周りで傾動しても良い。
Further, in step S3 relating to the illumination condition, the control means 12 raises or lowers the base 22 through a command to the base 22 so as to match the illumination height h acquired in the lens database 52. The position of the narrow-angle light irradiating means 7 with respect to the lens L is adjusted, and the illumination height h is adjusted. Further, the control means 12 tilts the irradiation unit 23 through a command to each tilt angle adjusting means 27 so as to match the illumination angle θ acquired by the lens database 52, thereby irradiating the spectacle lens L with narrow-angle light. The angle of the means 7 is adjusted to adjust the illumination angle θ.
The base 22 or each irradiation unit 23 may be rotatable around a vertical axis. Further, the base 22, or both the base 22 and each irradiation unit 23 may be tilted around the horizontal axis.

そして、制御手段12は、狭角光照射手段7に対して、第1照明部分M1,第2照明部分M2,第3照明部分M3あるいは第4照明部分M4の何れかにおいて所定の強度及び照明角度θで狭角光を発出させるための発光指令を送信し、これを受けて発光指令に係る狭角光照射手段7の照明部分における各狭角光LED24が点灯する。点灯した各狭角光LED24の各狭角光は、水平な眼鏡レンズLに対し、照明高さhの分だけ上方の位置から、照明角度θの分だけ傾いた光軸において照射される。
尚、照明設定値に照明強度が含まれるようにして、制御手段12はその照明強度で照明するように狭角光照射手段7を制御しても良い。又、照明強度、照明高さh及び照明角度θの少なくとも何れかは、照明部分の一部又は全部において互いに相違していても良い。
Then, the control means 12 has a predetermined intensity and illumination angle in any of the first illumination portion M1, the second illumination portion M2, the third illumination portion M3, and the fourth illumination portion M4 with respect to the narrow angle light irradiation means 7. A light emission command for emitting narrow angle light is transmitted at θ, and in response to this, each narrow angle light LED 24 in the illumination portion of the narrow angle light irradiation means 7 related to the light emission command is turned on. The narrow-angle light of each of the lit narrow-angle light LEDs 24 is emitted from a position above the horizontal spectacle lens L by the illumination height h on an optical axis tilted by the illumination angle θ.
The control means 12 may control the narrow-angle light irradiation means 7 so as to include the illumination intensity in the illumination set value and illuminate with the illumination intensity. Further, at least one of the illumination intensity, the illumination height h, and the illumination angle θ may be different from each other in a part or all of the illumination portion.

このようにして、眼鏡レンズLは、狭角光照射手段7から発せられた狭角光により照らされる。
狭角光は、透光性を有する眼鏡レンズLの内部を、眼鏡レンズLの光軸に交わる状態で通過し、理想的にはそのまま直進して眼鏡レンズLの外部に出る。かように直進した狭角光は、指向角が狭くその分拡散が緩やかであるから、眼鏡レンズLの上方に配置されたカメラ8には到達し難く、眼鏡レンズLの表面(空気との界面)における反射及び屈折の少なくとも何れか等により、ごく一部分がカメラ8に向かう。尚、照明角度θは、通常正の値をとり、狭角光は、眼鏡レンズLの斜め上方から斜め下方へ進む。
かような反射ないし屈折は、カーブの深いレンズ(眼鏡レンズL)ほど、様々な方向に向かうこととなる。又、狭角光が平行光である場合、平行光は水平に進むと集束も拡散もしないから、理想的には眼鏡レンズLの上方に配置されたカメラ8の方向には行かない。但し、実際には、上述した眼鏡レンズLの表面における反射、屈折等により、ごく一部分がカメラ8に向かう。
又、特に眼鏡レンズLに多用されるカーブの深いレンズにおいては、狭角光LED24の光源形状が映り込み、カメラ8に向かう(映り込みR1〜R4)。映り込みR1〜R4は、より詳しくは、眼鏡レンズLの輪郭に沿う弧に沿った点群あるいは濃淡帯状である。
そして、眼鏡レンズLに異物が付着しあるいは混入している場合、その異物に達した狭角光は散乱され、散乱光(異物による反射光)の一部がカメラ8に向かう。かような散乱光の強度は、上述の反射ないし屈折による光の強度より概して大きい。異物は、例えば、眼鏡レンズLの表面及び内部の少なくとも一方に発生した塵、着色ムラ、泡、固着物、欠片、若しくは眼鏡レンズLの表面に形成された膜のムラ、又はこれらの組合せである。
又、眼鏡レンズLにキズ、欠け、形成不良部分の少なくとも何れかが発生している場合、そのキズ、欠け、形成不良部分に達した狭角光も異物の場合と同様に散乱され、一部がカメラ8に向かう。以下、異物並びにキズ、欠け及び形成不良部分は、まとめて異物等と適宜呼ばれる。
加えて、狭角光照射手段7から発せられた狭角光は、エンクロージャ2の内面に達したとしても、その内面が反射防止面とされていることにより、その内面における反射が防止され、その内面による反射光がカメラ8に向かう事態が防止される。
ここでは、制御手段12は、自然数のループカウンタkが1〜4まで順に変わって合計4回繰り返されるループS4により、まず第1照明部分M1において照明させ、次いで第2照明部分M2,第3照明部分M3,第4照明部分M4の順で照明させる(ステップS5)。但し、制御手段は、眼鏡レンズLがプラスレンズである場合には、まず第3照明部分M3において照明させ、次いで第4照明部分M4,第1照明部分M1,第2照明部分M2の順で照明させる。尚、制御手段12は、これ以外の順番で照明させても良い。
In this way, the spectacle lens L is illuminated by the narrow-angle light emitted from the narrow-angle light irradiating means 7.
The narrow-angle light passes through the inside of the spectacle lens L having translucency in a state of intersecting the optical axis of the spectacle lens L, and ideally goes straight as it is and goes out of the spectacle lens L. Since the narrow-angle light traveling straight in this way has a narrow directivity angle and gradual diffusion, it is difficult to reach the camera 8 arranged above the spectacle lens L, and the surface of the spectacle lens L (interface with air). ), At least one of the reflections and refractions causes a small part to go toward the camera 8. The illumination angle θ usually takes a positive value, and the narrow-angle light travels diagonally upward to diagonally downward of the spectacle lens L.
Such reflection or refraction tends in various directions as the lens has a deeper curve (spectacle lens L). Further, when the narrow-angle light is parallel light, the parallel light does not focus or diffuse when traveling horizontally, and therefore does not ideally go in the direction of the camera 8 arranged above the spectacle lens L. However, in reality, a small part of the spectacle lens L is directed toward the camera 8 due to reflection, refraction, or the like on the surface of the spectacle lens L described above.
Further, particularly in a lens having a deep curve, which is often used for the spectacle lens L, the shape of the light source of the narrow-angle light LED 24 is reflected and heads toward the camera 8 (reflections R1 to R4). More specifically, the reflections R1 to R4 are a point cloud or a shading band along an arc along the contour of the spectacle lens L.
When foreign matter adheres to or is mixed in the spectacle lens L, the narrow-angle light that has reached the foreign matter is scattered, and a part of the scattered light (light reflected by the foreign matter) goes to the camera 8. The intensity of such scattered light is generally greater than the intensity of light due to reflection or refraction described above. The foreign matter is, for example, dust, uneven coloring, bubbles, fixed substances, fragments, unevenness of the film formed on the surface of the spectacle lens L, or a combination thereof, which is generated on at least one of the surface and the inside of the spectacle lens L. ..
Further, when at least one of scratches, chips, and poorly formed portions is generated on the spectacle lens L, the narrow-angle light reaching the scratches, chips, and poorly formed portions is also scattered as in the case of foreign matter, and is partially formed. Heads for camera 8. Hereinafter, foreign matter and scratches, chips, and poorly formed parts are collectively referred to as foreign matter and the like.
In addition, even if the narrow-angle light emitted from the narrow-angle light irradiating means 7 reaches the inner surface of the enclosure 2, the inner surface is an antireflection surface, so that the reflection on the inner surface is prevented. The situation where the reflected light from the inner surface is directed to the camera 8 is prevented.
Here, the control means 12 first illuminates the first illuminating portion M1 by the loop S4 in which the natural number loop counter k changes in order from 1 to 4 and is repeated a total of four times, and then the second illuminating portion M2 and the third illuminating portion M2. The portion M3 and the fourth illumination portion M4 are illuminated in this order (step S5). However, when the spectacle lens L is a plus lens, the control means first illuminates the third illuminating portion M3, then illuminates the fourth illuminating portion M4, the first illuminating portion M1, and the second illuminating portion M2 in that order. Let me. The control means 12 may be illuminated in any other order.

制御手段12は、第1照明部分M1(プラスレンズの場合第3照明部分M3)において照明させた後、カメラ8に対して撮像指令を発し、これを受けて、カメラ8は、シャッターを切り、カメラレンズ36により取り込まれた光を撮像素子30で捉え、静止画の画素情報の集合に変換して、適宜画像処理のうえで記憶手段32に第1検査用画像C1として記憶する。そして、制御手段12は、第2照明部分M2(プラスレンズの場合第4照明部分M4)に照明させたうえで同様に第2検査用画像C2を取得し、更に同様に第3照明部分M3(プラスレンズの場合第1照明部分M1)に係る第3検査用画像C3と、第4照明部分M4(プラスレンズの場合第2照明部分M2)に係る第4検査用画像C4を取得する(ステップS6,S4,S8)。ここでは、1個の照明部分に対して1枚ずつ(眼鏡レンズL1枚に対して合計4枚)の第1〜第4検査用画像C1〜C4が取得されるところ、更に多くの枚数が取得されても良い。又、カメラ8は、動画を撮像して、検査用動画を取得しても良い。
第1〜第4検査用画像C1〜C4は、物体側テレセントリックレンズであるカメラレンズ36によって取得されるため、カーブの深い眼鏡レンズLあるいは厚みの大きい眼鏡レンズLであっても、全ての部分においてピントが合う。よって、ピントが合わない部分において異物等により散乱光が発生してしまい、鮮明な画像が得られず、第1〜第4検査用画像C1〜C4による検査に支障を来たす事態が防止される。又、非テレセントリックレンズは、異物等により広がるように発生する散乱光について視差の分だけ歪んで捉えてしまい、異物等の実際の大きさあるいは状態が不明確となったり、異物等が複数存在する場合に一部の異物等を隠してしまったりする可能性があるところ、カメラレンズ36ではそのようなことがなく、全ての異物等について実際の大きさ及び状態で捉えることができる。ここで、厳密には、サイズの変化を完全に防止することは困難であるところ、非テレセントリックレンズによる撮像の場合と比べ、サイズの変化は顕著に抑制され、又眼鏡レンズLの中央と外周部のように眼鏡レンズLに高低差が存在する場合において、眼鏡レンズLの撮像部分における形状の変形が抑制される。
The control means 12 illuminates the first illumination portion M1 (third illumination portion M3 in the case of a plus lens), and then issues an image pickup command to the camera 8, and in response to this, the camera 8 releases the shutter. The light captured by the camera lens 36 is captured by the image pickup element 30, converted into a set of pixel information of a still image, appropriately processed by an image, and stored in the storage means 32 as the first inspection image C1. Then, the control means 12 similarly illuminates the second illuminating portion M2 (the fourth illuminating portion M4 in the case of a plus lens), acquires the second inspection image C2 in the same manner, and further similarly obtains the third illuminating portion M3 (in the case of a plus lens). In the case of a plus lens, the third inspection image C3 related to the first illumination portion M1) and the fourth inspection image C4 related to the fourth illumination portion M4 (in the case of the plus lens, the second illumination portion M2) are acquired (step S6). , S4, S8). Here, where the first to fourth inspection images C1 to C4 are acquired one by one for one illumination portion (a total of four images for one spectacle lens L), a larger number of images are acquired. May be done. Further, the camera 8 may capture a moving image and acquire a moving image for inspection.
Since the first to fourth inspection images C1 to C4 are acquired by the camera lens 36 which is an object-side telecentric lens, even if the spectacle lens L has a deep curve or the spectacle lens L has a large thickness, all the parts thereof. It is in focus. Therefore, it is possible to prevent a situation in which scattered light is generated due to a foreign substance or the like in the out-of-focus portion, a clear image cannot be obtained, and the inspection by the first to fourth inspection images C1 to C4 is hindered. In addition, the non-telecentric lens distorts the scattered light generated by the foreign matter and the like by the amount of the parallax, and the actual size or state of the foreign matter and the like becomes unclear, and there are a plurality of foreign matter and the like. In some cases, some foreign matter may be hidden, but the camera lens 36 does not have such a possibility, and all foreign matter can be captured in the actual size and state. Strictly speaking, it is difficult to completely prevent the size change, but the size change is remarkably suppressed as compared with the case of imaging with a non-telecentric lens, and the center and outer periphery of the spectacle lens L are suppressed. When there is a height difference in the spectacle lens L as described above, the deformation of the shape in the image pickup portion of the spectacle lens L is suppressed.

レンズデータベース52には、眼鏡レンズLの直径及びカーブ値等に応じた撮像距離が記憶されており、第1〜第4検査用画像C1〜C4において、眼鏡レンズLの全体においてピントが合う(眼鏡レンズLの全体が被写界深度内に収まる)ような撮像距離が予め求められ、眼鏡レンズLの直径及びカーブ値に対して一意であるレンズIDと対応付けて記憶されている。上述の通り、制御手段12は、リフト20を制御し、その撮像距離となるように、ステージ4及びレンズ保持機構6を介して眼鏡レンズLを移動させる。尚、カメラレンズ36は、少なくとも物体側においてテレセントリック効果を有するため、撮像距離にかかわらず実視野は一定である。
例えば、実視野が縦80mm横80mmであり、被写界深度が9mmであり、被写界深度の中心がカメラレンズ36の先端から150mmの位置にある場合において、床高が5mmのプラス強度数の眼鏡レンズL(凸レンズ)に対しては、制御手段12は床高中心(2.5mm)の位置が被写界深度の中心位置と合致するようにリフト20を作動させる。他方、同じ場合において、床高が6mmのマイナス強度数の眼鏡レンズL(凹レンズ)に対しては、制御手段12は床高中心(3mm)の位置が被写界深度の中心位置と合致するようにリフト20を作動させる。ここで、リフト20がない(撮像距離が調整されない)ときを考える。凸レンズはレンズ保持機構6の支持点から下方に位置している一方、凹レンズはレンズ保持機構6の支持点から上方に位置していることから、双方のレンズの占める合計の上下幅(床高方向の幅の合算値)は、支持点から下に5mm(凸レンズ)と上に6mm(凹レンズ)で11mmとなる。この11mmの上下幅は、9mmの被写界深度より大きく、従って、撮像距離が調整されない場合、凸レンズ及び凹レンズの少なくとも一方において部分的にピントが合わないこととなる。これに対し、レンズ外観検査装置1では、リフト20により撮像距離が調整されるため、凸レンズ及び凹レンズの双方において被写界深度内に位置させて、ピントを全体に亘り合わせることができる。
又、眼鏡レンズLは、その周縁を保持するレンズ保持機構6によって、天板3の孔5に上面視で重なる(オーバーラップする)ように保持され、カメラ8(カメラレンズ36)は、孔5と向かい合うように配置されており、孔5の内部(箱状のステージ4の内部)は、黒化処理されている。よって、カメラレンズ36と眼鏡レンズLと孔5は上下方向に並んで、孔5は眼鏡レンズLを挟んでカメラレンズ36と反対側に位置することとなり、かような配置とステージ4内面の黒化処理によって、第1〜第4検査用画像C1〜C4において散乱光の生じない部分をより黒くすることができ、異物等による散乱光に対するコントラスト比が向上する。又、ステージ4側へ進む散乱光の反射がステージ4の内部において防止され、異物等によらない散乱光の映り込みが抑制されて、第1〜第4検査用画像C1〜C4におけるコントラスト比の低下が防止される。更に、ステージ4が箱状であり、眼鏡レンズLの下方の部分(カメラレンズ36から見て眼鏡レンズLより向こう側の部分)の一部又は全部が覆われるため、エンクロージャ2内面における反射光等が眼鏡レンズLの下方に向かったとしても、ステージ4により遮断することができ、異物等によらない散乱光の映り込みが抑制されて、第1〜第4検査用画像C1〜C4におけるコントラスト比の低下が防止される。
カメラ8は、このようにして取得した第1〜第4検査用画像C1〜C4を、制御手段12に対して送信し、制御手段12は、通信手段42において受信した第1〜第4検査用画像C1〜C4を、記憶手段40において記憶する。ここでは、カメラ8は、第1〜第4検査用画像C1〜C4をそれぞれ取得した後直ちに送信する。尚、カメラ8は、第1〜第4検査用画像C1〜C4の組が揃ってから、これらの一組をまとめて送信しても良い。
The lens database 52 stores the imaging distance according to the diameter and curve value of the spectacle lens L, and in the first to fourth inspection images C1 to C4, the entire spectacle lens L is in focus (glasses). An imaging distance (the entire lens L is within the depth of view) is obtained in advance, and is stored in association with a lens ID unique to the diameter and curve value of the spectacle lens L. As described above, the control means 12 controls the lift 20 and moves the spectacle lens L via the stage 4 and the lens holding mechanism 6 so as to have an imaging distance thereof. Since the camera lens 36 has a telecentric effect at least on the object side, the actual field of view is constant regardless of the imaging distance.
For example, when the actual field of view is 80 mm in length and 80 mm in width, the depth of field is 9 mm, and the center of the depth of field is at a position 150 mm from the tip of the camera lens 36, the floor height is a plus intensity number of 5 mm. With respect to the spectacle lens L (convex lens) of the above, the control means 12 operates the lift 20 so that the position of the center of the floor height (2.5 mm) matches the center position of the depth of field. On the other hand, in the same case, for the spectacle lens L (concave lens) having a floor height of 6 mm and a negative intensity number, the control means 12 so that the position of the floor height center (3 mm) matches the center position of the depth of field. The lift 20 is operated. Here, consider the case where the lift 20 is not provided (the imaging distance is not adjusted). Since the convex lens is located below the support point of the lens holding mechanism 6 and the concave lens is located above the support point of the lens holding mechanism 6, the total vertical width occupied by both lenses (in the floor height direction). The total value of the widths of the lenses is 5 mm below the support point (convex lens) and 6 mm above the support point (concave lens), which is 11 mm. This vertical width of 11 mm is larger than the depth of field of 9 mm, and therefore, if the imaging distance is not adjusted, at least one of the convex lens and the concave lens will be partially out of focus. On the other hand, in the lens appearance inspection device 1, since the imaging distance is adjusted by the lift 20, both the convex lens and the concave lens can be positioned within the depth of field and can be focused over the entire area.
Further, the spectacle lens L is held by the lens holding mechanism 6 that holds the peripheral edge thereof so as to overlap (overlap) the hole 5 of the top plate 3 in the top view, and the camera 8 (camera lens 36) is held in the hole 5. The inside of the hole 5 (the inside of the box-shaped stage 4) is blackened. Therefore, the camera lens 36, the spectacle lens L, and the hole 5 are arranged in the vertical direction, and the hole 5 is located on the opposite side of the spectacle lens L with the spectacle lens L in between. By the conversion treatment, the portion of the first to fourth inspection images C1 to C4 where the scattered light does not occur can be made blacker, and the contrast ratio with respect to the scattered light due to foreign matter or the like is improved. Further, the reflection of the scattered light traveling to the stage 4 side is prevented inside the stage 4, the reflection of the scattered light not due to foreign matter or the like is suppressed, and the contrast ratio in the first to fourth inspection images C1 to C4 is increased. The drop is prevented. Further, since the stage 4 has a box shape and partially or completely covers the lower portion of the spectacle lens L (the portion beyond the spectacle lens L when viewed from the camera lens 36), the reflected light or the like on the inner surface of the enclosure 2 or the like is covered. Is directed downward from the spectacle lens L, but can be blocked by the stage 4, the reflection of scattered light not due to foreign matter or the like is suppressed, and the contrast ratio in the first to fourth inspection images C1 to C4. Is prevented from decreasing.
The camera 8 transmits the first to fourth inspection images C1 to C4 thus acquired to the control means 12, and the control means 12 receives the first to fourth inspection images C1 to the communication means 42. Images C1 to C4 are stored in the storage means 40. Here, the camera 8 transmits immediately after acquiring the first to fourth inspection images C1 to C4, respectively. The camera 8 may transmit the sets of the first to fourth inspection images C1 to C4 together after the sets are prepared.

制御手段12のCPU44は、受信して記憶した第1検査用画像C1,第2検査用画像C2,第3検査用画像C3,第4検査用画像C4に対して、レンズ外観検査プログラム50の一部消去処理を実行し、第1画像部分N1,第2画像部分N2,第3画像部分N3,第4画像部分N4に係る消去を行って、第1検査用マスク画像D1,第2検査用マスク画像D2,第3検査用マスク画像D3,第4検査用マスク画像D4を生成する(ステップS7,S4,S8)。
即ち、マイナスレンズにおいて、第1照明部分M1(狭角光照射手段7の上から下に見て右上の部分)に係る照明により撮像した第1検査用画像C1中の眼鏡レンズLの撮像部分における、第1照明部分M1が映り込んだ部分である一部照明映り込み部分(第1照明部分M1に隣接する眼鏡レンズL撮像部分の右上部分)を含む第1画像部分N1(第1検査用画像C1の右上部分)が消去される。この消去において、消去対象部分は第1画像部分N1であり、眼鏡レンズL撮像部分における一部照明映り込み部分(第1照明部分M1の照射隣接部分)を含んでいる。又、第2画像部分N2〜第4画像部分N4は、それぞれ、第1画像部分N1と同様に消去される。
他方、プラスレンズにおいて、第3照明部分M3に係る照明により撮像した第1検査用画像C1中の眼鏡レンズL撮像部分における、第3照明部分M3が映り込んだ部分である一部照明映り込み部分(第3照明部分M3からみて眼鏡レンズL撮像部分の中心を挟んで向こう側の右上部分)を含む第1画像部分N1が消去される。この消去において、消去対象部分は第1画像部分N1であり、眼鏡レンズL撮像部分における一部照明映り込み部分(第3照明部分M3の向こう側の部分)を含んでいる。又、第2〜第4画像部分N2〜N4は、それぞれ、第1画像部分N1と同様に消去される。
これらの第1〜第4画像部分N1〜N4内における眼鏡レンズL撮像部分には、点灯している各狭角光LED24の光源形状に応じた映り込みR1〜R4が発生し得るところ、その映り込みR1〜R4が、一部消去処理により、第1〜第4検査用マスク画像D1〜D4において消去される。かような映り込みR1〜R4は、眼鏡レンズLを囲む各狭角光LED24が全て(全周で)点灯すると、眼鏡レンズLにおいて輪状となる。しかし、各狭角光LED24が部分的に(弧状に)点灯すると、これに対応して眼鏡レンズLにおいて弧状となる(一部照明映り込み部分)。よって、映り込み部分の一部消去が可能となり、映り込み部分がなく狭角光により適切に照明された部分を残した第1〜第4検査用マスク画像D1〜D4の取得が可能となる。
CPU44は、ここでは第1〜第4検査用画像C1〜C4の何れかを記憶手段40において記憶した後、直ちにその検査用画像に対する一部消去処理を行って、第1〜第4検査用マスク画像D1〜D4の生成を行う。尚、CPU44は、記憶手段40において第1〜第4検査用画像C1〜C4の組が揃ってから、これらの一組に対してそれぞれ一部消去処理を行っても良い。又、一部消去処理は、カメラ8において行われても良い。更に、一部消去処理において、CPU44は、第1〜第4検査用画像C1〜C4に上書きして第1〜第4検査用マスク画像D1〜D4を記憶しても良いし、第1〜第4検査用マスク画像D1〜D4の記憶後に第1〜第4検査用画像C1〜C4を削除しても良い。加えて、一部消去処理に付随して、ノイズリダクション処理等の他の画像処理が行われても良い。
The CPU 44 of the control means 12 is one of the lens appearance inspection programs 50 for the first inspection image C1, the second inspection image C2, the third inspection image C3, and the fourth inspection image C4 received and stored. The part erasing process is executed to erase the first image portion N1, the second image portion N2, the third image portion N3, and the fourth image portion N4 to perform the first inspection mask image D1, the second inspection mask. Images D2, third inspection mask images D3, and fourth inspection mask images D4 are generated (steps S7, S4, S8).
That is, in the minus lens, in the imaging portion of the spectacle lens L in the first inspection image C1 imaged by the illumination related to the first illumination portion M1 (the portion on the upper right when viewed from the top to the bottom of the narrow angle light irradiation means 7). , The first image portion N1 (the image for the first inspection) including a part of the illumination reflection portion (the upper right portion of the spectacle lens L imaging portion adjacent to the first illumination portion M1) which is the portion where the first illumination portion M1 is reflected. The upper right part of C1) is erased. In this erasure, the portion to be erased is the first image portion N1, and includes a partial illumination reflection portion (irradiation adjacent portion of the first illumination portion M1) in the spectacle lens L image pickup portion. Further, the second image portion N2 to the fourth image portion N4 are erased in the same manner as the first image portion N1, respectively.
On the other hand, in the plus lens, a part of the illumination reflection portion which is the portion where the third illumination portion M3 is reflected in the spectacle lens L imaging portion in the first inspection image C1 imaged by the illumination related to the third illumination portion M3. The first image portion N1 including (the upper right portion on the opposite side of the center of the spectacle lens L imaging portion as viewed from the third illumination portion M3) is erased. In this erasure, the portion to be erased is the first image portion N1, and includes a partial illumination reflection portion (a portion on the other side of the third illumination portion M3) in the spectacle lens L image pickup portion. Further, the second to fourth image portions N2 to N4 are erased in the same manner as the first image portion N1, respectively.
Reflections R1 to R4 corresponding to the shape of the light source of each of the lit narrow-angle light LEDs 24 can be generated in the spectacle lens L image pickup portions in the first to fourth image portions N1 to N4, and the reflections thereof. The inclusions R1 to R4 are erased in the first to fourth inspection mask images D1 to D4 by a partial erasing process. Such reflections R1 to R4 form a ring shape in the spectacle lens L when all the narrow-angle light LEDs 24 surrounding the spectacle lens L are turned on (over the entire circumference). However, when each narrow-angle light LED 24 is partially (arc-shaped) lit, the spectacle lens L correspondingly becomes arc-shaped (partially illuminated portion). Therefore, a part of the reflected portion can be erased, and the first to fourth inspection mask images D1 to D4 can be acquired without the reflected portion and leaving the portion appropriately illuminated by the narrow-angle light.
Here, the CPU 44 stores any one of the first to fourth inspection images C1 to C4 in the storage means 40, and then immediately performs a partial erasing process on the inspection image to perform the first to fourth inspection masks. Images D1 to D4 are generated. The CPU 44 may perform a partial erasing process on each of the sets of the first to fourth inspection images C1 to C4 after the sets of the first to fourth inspection images C1 to C4 are prepared in the storage means 40. Further, the partial erasing process may be performed by the camera 8. Further, in the partial erasing process, the CPU 44 may overwrite the first to fourth inspection images C1 to C4 to store the first to fourth inspection mask images D1 to D4, or may store the first to fourth inspection mask images D1 to D4. 4 The first to fourth inspection images C1 to C4 may be deleted after the inspection mask images D1 to D4 are stored. In addition, other image processing such as noise reduction processing may be performed in addition to the partial erasing processing.

又、制御手段12のCPU44は、ループS4〜S8が完了して第1〜第4検査用マスク画像D1〜D4を一組取得した後、レンズ外観検査プログラム50の合成処理を実行し、第1〜第4検査用マスク画像D1〜D4を参照して検査用合成画像Eを生成して、記憶手段32に記憶する(ステップS9)。
尚、検査用合成画像Eは、複数枚生成されても良いし、検査用合成画像Eの生成に付随して、2値化処理及びノイズリダクション処理の少なくとも一方等の他の画像処理が行われても良い。又、照明部分と一部消去の関係は、上述のマイナスレンズないしプラスレンズに係る関係以外のものであっても良い。複雑な表面形状を有するレンズであっても、照明部分による一部照明によって、その映り込み部分はレンズないしレンズ撮像部分における一部に留まる。そして、映り込み部分が一見分からないような類型のレンズであっても、各照明部分による照射が一度以上試行されれば、一部消去処理において消去する部分に包含されるべき映り込み部分は予め把握可能であり、この場合に、制御手段12は、試行結果を記憶させて、同じ類型のレンズの検査において当該試行結果を適用することができる。更に、制御手段12は、1個の照明部分による一部照明によって、レンズに複数の映り込み部分が生じる場合に、複数の画像部分(例えば2個の矩形部分)を消去しても良い。又、制御手段12は、複数の照明部分を照射したうえで、その照射による映り込み部分をマスクするようにしても良い。
Further, the CPU 44 of the control means 12 executes the synthesis process of the lens appearance inspection program 50 after the loops S4 to S8 are completed and a set of the first to fourth inspection mask images D1 to D4 is acquired, and the first -The inspection composite image E is generated with reference to the fourth inspection mask images D1 to D4, and is stored in the storage means 32 (step S9).
A plurality of composite images E for inspection may be generated, and other image processing such as at least one of binarization processing and noise reduction processing is performed in association with the generation of the composite image E for inspection. You may. Further, the relationship between the illuminated portion and the partial erasing may be other than the relationship related to the above-mentioned minus lens or plus lens. Even if the lens has a complicated surface shape, the reflected portion is limited to a part of the lens or the lens imaging portion due to the partial illumination by the illuminated portion. And even if the type of lens is such that the reflected part is not apparent at first glance, if irradiation by each illuminated part is tried more than once, the reflected part that should be included in the part to be erased in the partial erasing process is in advance. It is possible to grasp, and in this case, the control means 12 can store the trial result and apply the trial result in the inspection of the same type of lens. Further, the control means 12 may erase a plurality of image portions (for example, two rectangular portions) when a plurality of reflection portions are generated in the lens due to partial illumination by one illumination portion. Further, the control means 12 may irradiate a plurality of illuminated portions and then mask the reflected portion due to the irradiation.

そして、制御手段12は、記憶した検査用合成画像Eに対して、異常が発生しているか否かを判定する(ステップS10)。
ここでは、検査用合成画像E中の眼鏡レンズL撮像部分において所定値(例えば256段階中128)以上の輝度を有する画素が所定範囲(例えば3画素×3画素の範囲)以上に亘り存在するか否かにより判定する。かような画素群は、異物等に対応する。
尚、第1〜第4検査用画像C1〜C4の取得時若しくは取得後、あるいは第1〜第4検査用マスク画像D1〜D4の生成時若しくは生成後、又は検査用合成画像Eの生成時若しくは生成後において、眼鏡レンズL撮像部分以外の部分(狭角光照射手段7の撮像部分等)が消去され若しくはトリミングされても良い。又、第1〜第4検査用画像C1〜C4の取得時において、眼鏡レンズLより外方の部分が撮影範囲外に配置されても良い。更に、上述の判定は、複数の検査用合成画像Eに基づいてなされても良い。加えて、上述の判定は、所定範囲以内であっても輝度が第2の所定値(上記所定値と同じ値でも違う値でも良い)以上であるか否かによっても良いし、輝度が第3の所定値(上記所定値あるいは第2の所定値と同じ値でも違う値でも良い)以上である画素が所定個数以上隣接しているか否かによっても良いし、これらの組合せによっても良い。
Then, the control means 12 determines whether or not an abnormality has occurred in the stored inspection composite image E (step S10).
Here, in the spectacle lens L imaging portion in the composite image E for inspection, is there a pixel having a brightness of a predetermined value (for example, 128 out of 256 steps) or more over a predetermined range (for example, a range of 3 pixels × 3 pixels)? Judge by whether or not. Such a pixel group corresponds to a foreign substance or the like.
At the time of acquisition or acquisition of the first to fourth inspection images C1 to C4, at the time of generation or after generation of the first to fourth inspection mask images D1 to D4, or at the time of generation of the inspection composite image E or After the generation, a portion other than the spectacle lens L image pickup portion (the image pickup portion of the narrow angle light irradiation means 7 or the like) may be erased or trimmed. Further, when acquiring the first to fourth inspection images C1 to C4, the portion outside the spectacle lens L may be arranged outside the photographing range. Further, the above-mentioned determination may be made based on a plurality of composite images E for inspection. In addition, the above-mentioned determination may be made depending on whether or not the brightness is equal to or higher than the second predetermined value (the same value as or different from the above-mentioned predetermined value) even within the predetermined range, and the brightness is the third. It may depend on whether or not a predetermined number or more of pixels which are equal to or more than the predetermined value (the same value as or different from the above-mentioned predetermined value or the second predetermined value) are adjacent to each other, or a combination thereof may be used.

制御手段12は、眼鏡レンズL撮像部分において所定値以上の輝度を有する画素が所定範囲以上に亘り存在する場合、異物等による散乱光が存在して異物等が存在するものとして、検査用合成画像Eにおいて異常が発生しているとの判定結果を出す。
検査用合成画像Eにおいては、各狭角光LED24の映り込みR1〜R4が消去されているので、異常発生の判定において、映り込みR1〜R4を異物等として誤検知し、異物等が存在しないのに異常が発生しているとの判定結果を誤って出してしまう事態が防止される。又、複数枚の第1〜第4検査用マスク画像D1〜D4の平均化により検査用合成画像Eが生成されており、複数枚の第1〜第4検査用マスク画像D1〜D4の情報を有する検査用合成画像Eを用いて異常判定がなされるため、判定の精度が良好である。しかも、第1〜第4検査用画像C1〜C4は、ピント位置及び撮影範囲等を変えることなく少ない枚数で取得することができ、第1〜第4検査用マスク画像D1〜D4は所定の部分を消去するだけで生成できるので、処理量及び処理時間は少ない。
When the control means 12 has pixels having a brightness equal to or higher than a predetermined value in the spectacle lens L imaging portion over a predetermined range or more, it is assumed that scattered light due to foreign matter or the like is present and the foreign matter or the like is present. The judgment result that an abnormality has occurred in E is given.
In the composite image E for inspection, since the reflections R1 to R4 of each narrow-angle light LED 24 are erased, the reflections R1 to R4 are erroneously detected as foreign matter or the like in the determination of the occurrence of an abnormality, and the foreign matter or the like does not exist. However, it is possible to prevent a situation in which the judgment result that an abnormality has occurred is erroneously output. Further, the composite image E for inspection is generated by averaging the plurality of first to fourth inspection mask images D1 to D4, and the information of the plurality of first to fourth inspection mask images D1 to D4 can be obtained. Since the abnormality determination is made using the composite image E for inspection, the accuracy of the determination is good. Moreover, the first to fourth inspection images C1 to C4 can be acquired with a small number of images without changing the focus position, the photographing range, and the like, and the first to fourth inspection mask images D1 to D4 are predetermined portions. Since it can be generated only by erasing, the processing amount and processing time are small.

制御手段12は、検査用合成画像Eにおいて異常が発生しているとの判定結果を得た場合、検査対象に係る眼鏡レンズLの外観に異常が認められる旨(検査結果が異常であり眼鏡レンズLが外観異常のある不良品である旨)、報知手段9において報知させる。
異常発生の報知は、ブザー音の発生であっても良いし、ランプの点灯であっても良いし、メッセージの発音あるいは表示であっても良いし、これらの組合せであっても良い。又、報知手段9に表示手段が含まれる場合、表示手段において、一部消去前及び一部消去後の第1〜第4検査用画像C1〜C4並びに検査用合成画像Eの少なくとも何れかが表示されるようにしても良い。そして、その表示がなされる場合、異常発生の判定がその画像の目視により行われても良い。尚、かような異常発生報知処理は、省略されても良い。又、報知手段9は、異常が認められない旨(検査結果が正常である旨)を、異常発生報知の態様とは異なる態様で報知しても良い。
When the control means 12 obtains a determination result that an abnormality has occurred in the composite image E for inspection, the control means 12 indicates that an abnormality is found in the appearance of the spectacle lens L related to the inspection target (the inspection result is abnormal and the spectacle lens). L is a defective product having an abnormal appearance), and the notification means 9 is used to notify.
The notification of the occurrence of an abnormality may be the generation of a buzzer sound, the lighting of a lamp, the pronunciation or display of a message, or a combination thereof. When the notification means 9 includes a display means, at least one of the first to fourth inspection images C1 to C4 and the inspection composite image E before and after the partial erasure are displayed in the display means. It may be done. Then, when the display is made, the determination of the occurrence of an abnormality may be made by visual inspection of the image. It should be noted that such an abnormality occurrence notification process may be omitted. Further, the notification means 9 may notify that no abnormality is found (inspection result is normal) in a mode different from the mode of notification of abnormality occurrence.

制御手段12は、検査用合成画像Eに対する判定処理ないし異常発生報知処理が完了すると、狭角光照射手段7に対して消灯を指令すると共に、搬送手段により眼鏡レンズLを搬出し(ステップS11)、次の検査対象としての眼鏡レンズLが存在する場合には、以上の処理を繰り返す(Return To Start)。
尚、狭角光照射手段7における最初の照明に係る照明部分は、搬出時あるいは搬入前において点灯されていても良い。
When the determination process or the abnormality occurrence notification process for the composite image E for inspection is completed, the control means 12 commands the narrow-angle light irradiation means 7 to turn off the light, and carries out the spectacle lens L by the transport means (step S11). If the spectacle lens L as the next inspection target exists, the above processing is repeated (Return To Start).
The illuminated portion of the narrow-angle light irradiating means 7 related to the first illumination may be lit at the time of carrying out or before carrying in.

≪機械学習の動作等≫
このように成るレンズ外観検査装置1の動作例等が、主に図6に基づいて以下説明される。
レンズ外観検査装置1は、機械学習プログラム54を実行するCPU44(制御手段12)により、例えば次の通り動作する。
ここでは、図6の動作は、レンズ外観検査装置1の運用前に、複数種類の眼鏡レンズLを対象として繰り返し行われる(事前学習)。効率良く学習するためには、異物等の認められる様々な眼鏡レンズLが対象とされる。尚、図6の動作は、レンズ外観検査装置1の運用中、各眼鏡レンズLの検査毎等に行われても良い。
≪Machine learning operation, etc.≫
An operation example of the lens appearance inspection device 1 as described above will be described below mainly based on FIG.
The lens appearance inspection device 1 is operated by the CPU 44 (control means 12) that executes the machine learning program 54, for example, as follows.
Here, the operation of FIG. 6 is repeatedly performed for a plurality of types of spectacle lenses L before the operation of the lens appearance inspection device 1 (pre-learning). In order to learn efficiently, various spectacle lenses L in which foreign substances and the like are recognized are targeted. The operation of FIG. 6 may be performed for each inspection of each spectacle lens L during the operation of the lens appearance inspection device 1.

まず、制御手段12は、今回の照明条件、即ち照明高さha,照明角度θb(a,bはそれぞれ独立した任意の自然数;照明条件マトリクスLM参照)を選択する(ステップS21)。
当初においては、照明条件はランダムに選択される。尚、照明条件の初期値は、h1,θ1等、予め所定値に決定されていても良い。
制御手段12は、レンズ外観検査プログラム50により、今回の照明条件及び対象である眼鏡レンズLのレンズ条件(レンズID)において、今回の検査用合成画像Eabを撮像する。
First, the control means 12 selects the current lighting conditions, that is, the lighting height ha and the lighting angle θb (a and b are independent natural numbers; refer to the lighting condition matrix LM) (step S21).
Initially, the lighting conditions are randomly selected. The initial values of the lighting conditions may be predetermined values such as h1 and θ1.
The control means 12 captures the composite image Ab for inspection this time under the illumination conditions of this time and the lens condition (lens ID) of the target spectacle lens L by the lens appearance inspection program 50.

そして、制御手段12は、今回の照明条件で撮像された検査用合成画像Eabに異常があるか否かを判定する(ステップS22)。
異常がある場合には(YES)、ステップ23において報酬が増える。異常がない場合には(NO)、ステップ24において報酬が減る。このような報酬の増減は、報酬計算部72によって算出される。
尚、ステップ24において、報酬がそのままとされても良い。又、異常判定が段階的に行われる場合、例えば、異物等に相当する画素(群)の輝度及び範囲の少なくとも一方が、複数の閾値の内の何れを超えたかにより異常レベルが設定される場合に、異常判定の段階(異常レベル)の大きさに応じ、報酬の大きさが異なるものとされても良い。
Then, the control means 12 determines whether or not there is an abnormality in the inspection composite image Ab captured under the current lighting conditions (step S22).
If there is an abnormality (YES), the reward increases in step 23. If there is no abnormality (NO), the reward is reduced in step 24. Such an increase / decrease in the reward is calculated by the reward calculation unit 72.
In step 24, the reward may be left as it is. Further, when the abnormality determination is performed stepwise, for example, when the abnormality level is set depending on which of the plurality of thresholds the brightness and the range of the pixel (group) corresponding to the foreign matter or the like exceeds. In addition, the size of the reward may be different depending on the size of the abnormality determination stage (abnormal level).

その後、制御手段12は、関数更新部74により行動価値関数を更新する(ステップS25)。
制御手段12が学習部62により実行するQ学習は、ある環境状態sの下で、行動aを選択する価値(行動の価値)Q(s,a)を学習するものである。Q学習では、ある状態sのときに、Q(s,a)の最も高い行動aを選択する。Q学習では、試行錯誤により、ある状態sの下で様々な行動aをとり、そのときの報酬を用いて正しいQ(s,a)を学習する。行動価値関数Q(s,a)の更新式は次の式(1)で表される。
After that, the control means 12 updates the action value function by the function update unit 74 (step S25).
The Q-learning executed by the control means 12 by the learning unit 62 learns the value (value of action) Q (s, a) of selecting the action a under a certain environmental state s. In Q-learning, the action a having the highest Q (s, a) is selected in a certain state s. In Q-learning, various actions a are taken under a certain state s by trial and error, and the correct Q (s, a) is learned using the reward at that time. The update formula of the action value function Q (s, a) is expressed by the following formula (1).

Figure 2021173644
Figure 2021173644

ここで、s,aは時刻tにおける環境,行動を表し、γは割引率、αは学習係数を表す。
行動aにより、環境はst+1に変化し、その環境の変化によって、報酬rt+1が計算される。
又、maxに係る項は、環境st+1の下で、そのときに分かっている最もQ値の高い行動aを選んだ場合のQ値に割引率γを掛けたものである。割引率γは、先のQ値を重視する度合を示すパラメータであり、0<γ≦1であり、多くの場合0.9以上0.99以下の値とされる。
他方、学習係数αは、学習の速度を調整するパラメータであり、多くの場合0.1程度とされる。
Here, s t, a t represents the environment at time t, the action, γ is the discount rate, α represents a learning coefficient.
By the action a t, the environment is changed to s t + 1, by a change in its environment, reward r t + 1 is calculated.
Further, the term related to max is obtained by multiplying the Q value when the action a having the highest Q value known at that time is selected under the environment st + 1 by the discount rate γ. The discount rate γ is a parameter indicating the degree to which the above Q value is emphasized, and is 0 <γ ≦ 1, and is often set to a value of 0.9 or more and 0.99 or less.
On the other hand, the learning coefficient α is a parameter for adjusting the learning speed, and is often set to about 0.1.

この式(1)は、状態sにおける行動aの評価値Q(s,a)よりもaによる次の環境状態における最良の行動の評価値Q(st+1,maxat+1)の方が大きければ、Q(s,a)を大きくするし、逆に小さければ、Q(s,a)も小さくすることを示している。つまり、ある状態におけるある行動の価値を、それによる次の状態における最良の行動の価値に近づけるようにしている。
換言すれば、制御手段12は、学習部62により、特定のレンズ条件(レンズID)において異常検査を実行するのに最も適した照明の状態、つまり検査用合成画像E取得時の最適な照明条件を更新する。
The equation (1), the evaluation value Q (s t, a t) of action a in state s is one of evaluation value of the best action Q (s t + 1, maxa t + 1) at the following environmental conditions by a than larger if, Q (s t, a t ) to increase the, smaller Conversely, Q (s t, a t ) show that also small. In other words, the value of one action in one state is brought closer to the value of the best action in the next state.
In other words, the control means 12 uses the learning unit 62 to obtain the most suitable lighting state for performing the abnormality inspection under a specific lens condition (lens ID), that is, the optimum lighting condition at the time of acquiring the inspection composite image E. To update.

このようにして、ステップS25では、制御手段12は、関数更新部74により上記式(1)を用いて行動価値関数を更新する。
そして、制御手段12は、ステップS21に戻り、他の照明条件が選択され、同様にして行動価値関数が更新される。
尚、ステップS21において、初期段階での前回無報酬時等に、照明条件として、前回のものと異なるランダムなもの、あるいは前回のものに(照明条件マトリクスLM上で)隣接するものが選択されても良い。又、行動価値関数の代わりに、行動価値テーブルが設けられ、行動価値テーブルが更新されても良い。
In this way, in step S25, the control means 12 updates the action value function by the function update unit 74 using the above equation (1).
Then, the control means 12 returns to step S21, another lighting condition is selected, and the action value function is updated in the same manner.
In step S21, at the time of the previous non-reward in the initial stage, a random lighting condition different from the previous one or a lighting condition adjacent to the previous one (on the lighting condition matrix LM) is selected. Is also good. Further, instead of the action value function, an action value table may be provided and the action value table may be updated.

制御手段12は、ステップS21〜S25の所定回数の繰り返しにより学習が進行すると、次の眼鏡レンズLにおける学習を同様に行い、適宜これを繰り返す。
尚、制御手段12は、最初に報酬が得られた段階あるいは所定以上の大きさの報酬が得られた段階等といった、所定回数完了後とは異なる段階において、今回の眼鏡レンズLにおける学習を終えても良い。
When learning progresses by repeating steps S21 to S25 a predetermined number of times, the control means 12 similarly performs learning on the next spectacle lens L, and repeats this as appropriate.
The control means 12 finishes the learning in the spectacle lens L at a stage different from that after the completion of the predetermined number of times, such as the stage where the reward is first obtained or the stage where the reward of a predetermined size or more is obtained. You may.

かように、強化学習においては、エージェントとしての学習部62が、環境の状況に基づいて行動を決定する。
ここでの行動は、関数更新部74によって更新される行動価値関数によって定められた照明条件の下での検査用合成画像Eの取得であり、意思決定部64及びレンズ外観検査プログラム50を介して実行されるものである。
そして、かように調整された照明条件によって、環境、即ち検査用合成画像Eによる異常検査の正確性等が変化する。
そのような環境の変化に伴って、報酬が機械学習プログラム54により与えられ、報酬計算部72及び関数更新部74は、より高い報酬が与えられるように、より良い行動の選択を学習する。この選択の学習は、意思決定部64における意思決定の学習とも捉えられる。学習結果は、学習結果記憶部76に記憶される。
As described above, in reinforcement learning, the learning unit 62 as an agent determines the action based on the environmental situation.
The action here is the acquisition of the composite image E for inspection under the lighting conditions determined by the action value function updated by the function update unit 74, via the decision-making unit 64 and the lens appearance inspection program 50. It is what is executed.
Then, the environment, that is, the accuracy of the abnormality inspection by the composite image E for inspection, and the like change depending on the lighting conditions adjusted in this way.
With such changes in the environment, rewards are given by the machine learning program 54, and the reward calculation unit 72 and the function update unit 74 learn to select better actions so that higher rewards are given. This learning of selection can be regarded as learning of decision making in the decision making unit 64. The learning result is stored in the learning result storage unit 76.

よって、図6の処理が多数回繰り返されることにより、行動価値関数の信頼度が高められる。そして、ステップS21において、信頼性の高い行動価値関数に基づいて、例えばQ値が最も高くなるように照明条件をより最適に決定することができる。
このようにして、機械学習プログラム54の関数更新部74により更新された内容は、検査用合成画像Eのための第1〜第4検査用画像C1〜C4撮像時の照明条件として自動的に決定される。
そして、そのような機械学習プログラム54の導入により、眼鏡レンズL(レンズ条件)毎の最適な照明条件が自動的に作成される。機械学習により決定された最適な照明条件は、レンズデータベース52に反映され、レンズ外観検査の運用時に参照される。レンズデータベース52は、レンズ条件(レンズID)に応じた最適な照明条件において自動的に作成され、ユーザーが眼鏡レンズL毎に様々な照明角度θ,照明高さhの下で最適な第1〜第4検査用画像C1〜C4の撮像を都度試行してレンズデータベース52を形成する必要がない。
尚、運用中に機械学習(図6の動作)が行われる場合、行動価値関数に係る最適な照明条件におけるレンズ外観検査が、意思決定部64を介して自動的に行われつつ、機械学習が更に進行することとなる。
Therefore, the reliability of the action value function is increased by repeating the process of FIG. 6 many times. Then, in step S21, the lighting condition can be more optimally determined so that, for example, the Q value is the highest, based on the highly reliable action value function.
In this way, the content updated by the function update unit 74 of the machine learning program 54 is automatically determined as the illumination conditions at the time of capturing the first to fourth inspection images C1 to C4 for the inspection composite image E. Will be done.
Then, by introducing such a machine learning program 54, the optimum lighting conditions for each spectacle lens L (lens condition) are automatically created. The optimum lighting conditions determined by machine learning are reflected in the lens database 52 and referred to during the operation of the lens appearance inspection. The lens database 52 is automatically created under the optimum lighting conditions according to the lens conditions (lens ID), and the user can use the optimum 1st to 1st under the various lighting angles θ and the lighting height h for each spectacle lens L. It is not necessary to try to capture the fourth inspection images C1 to C4 each time to form the lens database 52.
When machine learning (operation in FIG. 6) is performed during operation, machine learning is performed while the lens appearance inspection under the optimum lighting conditions related to the action value function is automatically performed via the decision-making unit 64. It will proceed further.

≪効果等≫
以上のレンズ外観検査装置1は、眼鏡レンズLに対して照明光を照射可能な狭角光照射手段7と、眼鏡レンズLが含まれる検査用合成画像Eのための第1〜第4検査用画像C1〜C4を撮像するカメラ8と、狭角光照射手段7による照明光の照射についての照明条件、及びカメラ8による第1〜第4検査用画像C1〜C4の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習プログラム54と、を備えており、機械学習プログラム54は、照明条件及びカメラ条件の少なくとも何れかと、検査用合成画像Eにおける異常判定の状態とに係る状態変数を観測する状態観測部60と、状態変数に基づいて、照明条件及びカメラ条件の少なくとも何れかを決定する行動価値関数を更新することによって、照明条件及びカメラ条件の少なくとも何れかを決定することを学習する学習部62と、を有しており、学習部62は、状態変数に基づいて、照明条件及びカメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部72と、報酬計算部72により計算された報酬に基づいて、行動価値関数を更新する関数更新部74と、を有しており、関数更新部74による行動価値関数の更新を繰り返すことによって、報酬が最も多く得られる照明条件及びカメラ条件の少なくとも何れかを学習する。
よって、レンズ外観検査装置1では、照明条件について眼鏡レンズL毎に最適な検査用合成画像Eが得られるようにユーザーが都度試行する必要がなく、様々な眼鏡レンズLが手間の少ない状態で適切に検査可能である。
≪Effects, etc.≫
The lens appearance inspection device 1 described above includes a narrow-angle light irradiation means 7 capable of irradiating the spectacle lens L with illumination light, and a first to fourth inspection for an inspection composite image E including the spectacle lens L. At least the illumination conditions for the camera 8 that captures the images C1 to C4 and the irradiation of the illumination light by the narrow-angle light irradiation means 7, and the camera conditions for the imaging of the first to fourth inspection images C1 to C4 by the camera 8. A machine learning program 54 for machine learning to determine which one is provided, and the machine learning program 54 relates to at least one of a lighting condition and a camera condition and a state of abnormality determination in the composite image E for inspection. At least one of the lighting condition and the camera condition is determined by updating the state observing unit 60 that observes the state variable and the action value function that determines at least one of the lighting condition and the camera condition based on the state variable. It has a learning unit 62 for learning that, and the learning unit 62 includes a reward calculation unit 72 for calculating a reward for a result of determining at least one of a lighting condition and a camera condition based on a state variable. It has a function update unit 74 that updates the action value function based on the reward calculated by the reward calculation unit 72, and the reward is the largest by repeating the update of the action value function by the function update unit 74. Learn at least one of the obtained lighting conditions and camera conditions.
Therefore, in the lens appearance inspection device 1, it is not necessary for the user to try each time so as to obtain the optimum inspection composite image E for each spectacle lens L with respect to the lighting conditions, and various spectacle lenses L are suitable in a state of less trouble. Can be inspected.

又、狭角光照射手段7は、眼鏡レンズLに対する照明光の照明角度θ及び照明高さhの少なくとも一方を相対的に変更可能であり、照明条件は、照明角度θ及び照明高さhの少なくとも一方を含んでいる。よって、レンズ外観検査装置1では、照明角度θ及び照明高さhの少なくとも一方について、照明条件として機械学習可能となる。
更に、眼鏡レンズLとカメラ8との間の距離である撮像距離を調整するリフト20を備えており、カメラ条件は、撮像距離、露光時間、及びゲインの内の少なくとも何れかを含んでいる。よって、レンズ外観検査装置1では、撮像距離、露光時間、及びゲインの内の少なくとも何れかについて、カメラ条件として機械学習可能となる。又、撮像距離がリフト20によって可変であることにより、互いに相違する特性値(レンズ条件,レンズID)を有する眼鏡レンズLを続けて検査する場合であっても、その特性値に合うような撮像距離を確保することができ、何れの特性値に係る眼鏡レンズLにおいても全体に亘り鮮明な第1〜第4検査用画像C1〜C4を少ない枚数(ここでは合計4枚)において取得することができて、処理量及び検査時間が少なく且つ正確である検査を実現することができる。
Further, the narrow-angle light irradiation means 7 can relatively change at least one of the illumination angle θ and the illumination height h of the illumination light with respect to the spectacle lens L, and the illumination conditions are the illumination angle θ and the illumination height h. Includes at least one. Therefore, in the lens appearance inspection device 1, machine learning is possible as illumination conditions for at least one of the illumination angle θ and the illumination height h.
Further, the lift 20 for adjusting the imaging distance, which is the distance between the spectacle lens L and the camera 8, is provided, and the camera conditions include at least one of the imaging distance, the exposure time, and the gain. Therefore, the lens appearance inspection device 1 can perform machine learning as a camera condition for at least one of the imaging distance, the exposure time, and the gain. Further, since the imaging distance is variable by the lift 20, even when the spectacle lens L having different characteristic values (lens condition, lens ID) is continuously inspected, the imaging is performed so as to match the characteristic values. It is possible to secure a distance, and for the spectacle lens L related to any characteristic value, it is possible to acquire clear images C1 to C4 for the first to fourth inspections in a small number of images (here, a total of four images). Therefore, it is possible to realize an accurate inspection with a small amount of processing amount and inspection time.

加えて、第1〜第4検査用画像C1〜C4を処理する制御手段12を備えており、狭角光照射手段7は、眼鏡レンズLの光軸を囲む囲み線の一部にそれぞれ相当する部分を占める複数の第1〜第4照明部分M1〜M4から、照明光を切替えて照射可能であり、カメラ8は、狭角光照射手段7による複数の第1〜第4照明部分M1〜M4における照射毎に第1〜第4検査用画像C1〜C4を撮像し、制御手段12は、複数の第1〜第4照明部分M1〜M4の照射毎に撮像した第1〜第4検査用画像C1〜C4中の眼鏡レンズL撮像部分における、第1〜第4照明部分M1〜M4が映り込んだ部分をそれぞれ消去して、複数の検査用マスク画像D1〜D4を生成する一部消去処理と、複数の第1〜第4検査用マスク画像D1〜D4を合成して検査用合成画像Eを生成する合成処理と、を行う。
よって、カメラ8は、第1〜第4検査用画像C1〜C4の取得において、異物等のない正常な部分を眼鏡レンズLの光軸交差方向に透過する狭角光を殆ど捉えない一方、異物等のある異常な部分に達して反射された狭角光を鮮明に捉えることとなり、第1〜第4検査用画像C1〜C4におけるコントラスト比が極めて良好になって、その分異物等を発見し易くなる。又、第1〜第4照明部分M1〜M4において狭角光を切替えて照射可能である狭角光照射手段7で眼鏡レンズLが照明されることにより、コントラスト比を良好にするために照明強度を十分なものとしても、眼鏡レンズL中の照明光源の映り込みが部分的なものとなる。そして、制御手段12が、一部消去処理で第1〜第4検査用画像C1〜C4において眼鏡レンズLの映り込み部分を含む第1〜第4画像部分N1〜N4を消去して第1〜第4検査用マスク画像D1〜D4を生成し、これらを合成処理で合成して検査用合成画像Eを生成することにより、眼鏡レンズL撮像部分における映り込みを消去しながら眼鏡レンズL全体をカバーした検査用合成画像Eを取得することができて、適切に照明された部分の結集された検査用合成画像Eを用いた、処理量及び処理時間の比較的に少ない正確な外観検査が確保される。レンズ外観検査装置1では、かように正確な外観検査が、機械学習により様々な眼鏡レンズLにおいて手間の少ない状態で行える。
又、狭角光照射手段7における囲み線は、眼鏡レンズLを囲む円環又は正多角形であり、狭角光照射手段7における第1〜第4照明部分M1〜M4は、円環又は正多角形を均等に分割した場合の円環の部分又は正多角形の部分であり、制御手段12の一部消去処理における消去対象部分は、第1〜第4検査用画像C1〜C4をその中心から発する放射方向の直線で均等に分割した場合の第1〜第4検査用画像C1〜C4の部分である。よって、分割照明及び一部消去処理が均等な部分を対象とすることにより円滑で正確に行われることとなり、合成処理も消去対象部分の重複しない第1〜第4検査用マスク画像D1〜D4が対象となり円滑で正確に行われることとなって、処理量及び処理時間の比較的に少ない正確な外観検査が確保される。
In addition, the control means 12 for processing the first to fourth inspection images C1 to C4 is provided, and the narrow-angle light irradiation means 7 corresponds to a part of the surrounding line surrounding the optical axis of the spectacle lens L, respectively. It is possible to switch and irradiate the illumination light from the plurality of first to fourth illumination portions M1 to M4 that occupy the portion, and the camera 8 uses the narrow angle light irradiation means 7 to irradiate the plurality of first to fourth illumination portions M1 to M4. The first to fourth inspection images C1 to C4 were imaged for each irradiation in the above, and the control means 12 captured the first to fourth inspection images for each irradiation of the plurality of first to fourth illumination portions M1 to M4. A partial erasing process for erasing each of the portions in which the first to fourth illumination portions M1 to M4 are reflected in the spectacle lens L imaging portion in C1 to C4 to generate a plurality of inspection mask images D1 to D4. , A compositing process of synthesizing a plurality of first to fourth inspection mask images D1 to D4 to generate an inspection composite image E is performed.
Therefore, in the acquisition of the first to fourth inspection images C1 to C4, the camera 8 hardly captures the narrow-angle light transmitted through the normal portion without foreign matter in the optical axis crossing direction of the spectacle lens L, while the camera 8 hardly catches the foreign matter. The narrow-angle light that has reached an abnormal part such as the above and is reflected is clearly captured, and the contrast ratio in the first to fourth inspection images C1 to C4 becomes extremely good, and foreign matter and the like are found by that amount. It will be easier. Further, the spectacle lens L is illuminated by the narrow-angle light irradiation means 7 capable of switching and irradiating the narrow-angle light in the first to fourth illumination portions M1 to M4, so that the illumination intensity is improved in order to improve the contrast ratio. Even if the above is sufficient, the reflection of the illumination light source in the spectacle lens L is partial. Then, the control means 12 erases the first to fourth image portions N1 to N4 including the reflection portion of the spectacle lens L in the first to fourth inspection images C1 to C4 by the partial erasing process, and the first to first to fourth inspection images C1 to C4. By generating the fourth inspection mask images D1 to D4 and synthesizing them by a composite process to generate the inspection composite image E, the entire spectacle lens L is covered while erasing the reflection in the spectacle lens L imaging portion. It is possible to obtain the inspection composite image E, and an accurate visual inspection with a relatively small amount of processing amount and processing time is ensured using the inspection composite image E in which the appropriately illuminated parts are gathered. NS. In the lens visual inspection apparatus 1, such accurate visual inspection can be performed by machine learning on various spectacle lenses L with less effort.
Further, the surrounding line in the narrow angle light irradiation means 7 is a ring or a regular polygon surrounding the spectacle lens L, and the first to fourth illumination portions M1 to M4 in the narrow angle light irradiation means 7 are a ring or a regular. The part of the ring or the part of the regular polygon when the polygon is evenly divided, and the part to be erased in the partial erasing process of the control means 12 is centered on the first to fourth inspection images C1 to C4. It is a part of the first to fourth inspection images C1 to C4 when it is evenly divided by a straight line in the radial direction emanating from. Therefore, the divided illumination and the partial erasing process are performed smoothly and accurately by targeting the uniform portion, and the compositing process is also performed by the first to fourth inspection mask images D1 to D4 in which the erased target portions do not overlap. It becomes a target and is performed smoothly and accurately, and an accurate visual inspection with a relatively small amount of processing amount and processing time is ensured.

更に、照明光は、指向角が30°以下の狭角光である。よって、照明高さhからの照明角度θの照明光が比較的に広がらずに眼鏡レンズLに達することとなる等、第1〜第4検査用画像C1〜C4が、照明条件がより良好に保持された状態で、より適切に撮像される。
又、カメラ8は、眼鏡レンズLに向けられたカメラレンズ36を有しており、カメラレンズ36は、物体側テレセントリックレンズ又は両側テレセントリックレンズである。
更に、内面が反射防止面とされているステージ4(箱体)を備えており、ステージ4は、孔5を有しており、眼鏡レンズLを挟んでカメラ8(カメラレンズ36)と反対側に孔5が位置するように配置されている。よって、カメラレンズ36から見て眼鏡レンズLの向こう側のステージ4の内面を眼鏡レンズLに対して離隔させることができ、又ステージ4内に反射光(繰り返しの反射光を適宜含む,以下同様)が進入することが防止され、僅かに進入したとしても反射防止面により反射を抑制され、結果眼鏡レンズLとの距離が確保された上述の内面を反射光あるいは散乱光が照らさないようになることでコントラスト比の低下を抑制し、第1〜第4検査用画像C1〜C4においてコントラスト比を更に向上することができ、より精度の高い検査が行える第1〜第4検査用画像C1〜C4を取得することができる。
又更に、眼鏡レンズL及び狭角光照射手段7、並びに、カメラ8を覆うエンクロージャ2を備えており、エンクロージャ2の内面は、照明光の反射が防止される反射防止面となるよう、黒色に塗られている。従って、外部からエンクロージャ2への外光(自然光及び照明光の少なくとも一方等)の進入を防止して、第1〜第4検査用画像C1〜C4における外光の現出を防止することができるし、エンクロージャ2内面における狭角光の反射を抑制して、その反射光の第1〜第4検査用画像C1〜C4における現出を防止し、第1〜第4検査用画像C1〜C4において優れたコントラスト比を実現することができ、より精度の高い検査が行える第1〜第4検査用画像C1〜C4を取得することができる。
Further, the illumination light is a narrow angle light having a directivity angle of 30 ° or less. Therefore, the illumination conditions of the first to fourth inspection images C1 to C4 are better, such that the illumination light at the illumination angle θ from the illumination height h reaches the spectacle lens L without relatively spreading. In the held state, the image is taken more appropriately.
Further, the camera 8 has a camera lens 36 directed to the spectacle lens L, and the camera lens 36 is an object-side telecentric lens or a bilateral telecentric lens.
Further, a stage 4 (box body) whose inner surface is an antireflection surface is provided, and the stage 4 has a hole 5 and is opposite to the camera 8 (camera lens 36) with the spectacle lens L interposed therebetween. The hole 5 is arranged so as to be located there. Therefore, the inner surface of the stage 4 on the other side of the spectacle lens L as viewed from the camera lens 36 can be separated from the spectacle lens L, and the reflected light (including repeated reflected light as appropriate) in the stage 4 is the same below. ) Is prevented from entering, and even if it enters slightly, reflection is suppressed by the antireflection surface, and as a result, the reflected light or scattered light does not illuminate the above-mentioned inner surface where the distance from the spectacle lens L is secured. As a result, the decrease in the contrast ratio can be suppressed, the contrast ratio can be further improved in the first to fourth inspection images C1 to C4, and the first to fourth inspection images C1 to C4 can be inspected with higher accuracy. Can be obtained.
Furthermore, the spectacle lens L, the narrow-angle light irradiation means 7, and the enclosure 2 that covers the camera 8 are provided, and the inner surface of the enclosure 2 is black so as to be an antireflection surface that prevents reflection of the illumination light. It is painted. Therefore, it is possible to prevent the intrusion of external light (at least one of natural light and illumination light) from the outside into the enclosure 2 and prevent the appearance of external light in the first to fourth inspection images C1 to C4. However, the reflection of the narrow-angle light on the inner surface of the enclosure 2 is suppressed to prevent the reflected light from appearing in the first to fourth inspection images C1 to C4, and the reflected light is prevented from appearing in the first to fourth inspection images C1 to C4. It is possible to obtain images C1 to C4 for the first to fourth inspections, which can realize an excellent contrast ratio and can perform a more accurate inspection.

他方、眼鏡レンズLに対する照明光の照射についての照明条件、及びカメラ8による検査用合成画像Eのための第1〜第4検査用画像C1〜C4の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習装置(機械学習プログラム54を実行する制御手段12)であって、照明条件及びカメラ条件の少なくとも何れかと、検査用合成画像Eにおける異常判定の状態とに係る状態変数を観測する状態観測部60と、状態変数に基づいて、照明条件及びカメラ条件の少なくとも何れかを決定する行動価値関数を更新することによって、照明条件及びカメラ条件の少なくとも何れかを決定することを学習する学習部62と、を有しており、学習部62は、状態変数に基づいて、照明条件及びカメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部72と、報酬計算部72により計算された報酬に基づいて、行動価値関数を更新する関数更新部74と、を有しており、関数更新部74による行動価値関数の更新を繰り返すことによって、報酬が最も多く得られる照明条件及びカメラ条件の少なくとも何れかを学習する。
従って、機械学習プログラム54を実行する制御手段12によって、様々な眼鏡レンズLが適切に検査可能なレンズ外観検査装置1用のレンズデータベース52が、手間の少ない状態で自動的に形成される。
On the other hand, at least one of the illumination conditions for irradiating the spectacle lens L with the illumination light and the camera conditions for capturing the first to fourth inspection images C1 to C4 for the inspection composite image E by the camera 8 is determined. A machine learning device (control means 12 for executing the machine learning program 54) that machine-learns what to do, and is a state variable related to at least one of lighting conditions and camera conditions and a state of abnormality determination in the composite image E for inspection. By updating the state observing unit 60 for observing and the action value function for determining at least one of the lighting condition and the camera condition based on the state variable, it is possible to determine at least one of the lighting condition and the camera condition. It has a learning unit 62 for learning, and the learning unit 62 has a reward calculation unit 72 for calculating a reward for a result of determining at least one of a lighting condition and a camera condition based on a state variable, and a reward calculation. It has a function update unit 74 that updates the action value function based on the reward calculated by the unit 72, and the most reward is obtained by repeating the update of the action value function by the function update unit 74. Learn at least one of the lighting conditions and the camera conditions.
Therefore, the control means 12 that executes the machine learning program 54 automatically forms the lens database 52 for the lens appearance inspection device 1 that can appropriately inspect various spectacle lenses L with less effort.

≪変更例等≫
本発明の実施形態は、上述の変更例に加え、更に次の変更例を適宜有する。
それぞれ機械学習プログラム54を有する複数のレンズ外観検査装置1における機械学習の結果(各学習結果記憶部76)が統合的に参酌されることで、行動価値関数が更新されても良い。この場合、各レンズ外観検査装置1に直接あるいは間接的につながった上位コンピュータが設けられ、その上位コンピュータに各学習結果が集積されても良いし、各レンズ外観検査装置1に直接あるいは間接的につながった一部のレンズ外観検査装置1に各学習結果が集積されても良い。
第1〜第4検査用画像C1〜C4から検査用合成画像Eを合成する(レンズ外観検査プログラム50を実行する)制御手段12と、機械学習を行う(機械学習プログラム54を実行する)制御手段12とが別体であっても良く、制御手段12は、更に細分化されていても良い。
≪Change example etc.≫
In addition to the above-mentioned modified examples, the embodiment of the present invention further includes the following modified examples as appropriate.
The action value function may be updated by integrally considering the machine learning results (each learning result storage unit 76) in the plurality of lens appearance inspection devices 1 each having the machine learning program 54. In this case, an upper computer directly or indirectly connected to each lens appearance inspection device 1 may be provided, and each learning result may be accumulated in the upper computer, or each lens appearance inspection device 1 may be directly or indirectly connected. Each learning result may be accumulated in a part of the connected lens appearance inspection devices 1.
Control means 12 that synthesizes inspection composite images E from the first to fourth inspection images C1 to C4 (executes the lens appearance inspection program 50) and control means that performs machine learning (executes the machine learning program 54). 12 may be a separate body, and the control means 12 may be further subdivided.

機械学習(状態変数)は、合成されない検査用画像を対象とする等、第1〜第4検査用画像C1〜C4から第1〜第4検査用マスク画像D1〜D4を経て生成された検査用合成画像E以外の検査用画像を対象としても良い。
機械学習は、照明角度θ及び照明高さh以外の照明に係る要素に対し、照明角度θ及び照明高さhと同様に行っても良い。
Machine learning (state variable) is for inspection generated through the first to fourth inspection mask images D1 to D4 from the first to fourth inspection images C1 to C4, such as targeting unsynthesized inspection images. An inspection image other than the composite image E may be targeted.
Machine learning may be performed on elements related to illumination other than the illumination angle θ and the illumination height h in the same manner as the illumination angle θ and the illumination height h.

又、機械学習は、レンズ外観検査における照明条件以外の条件、例えば他の検査条件であるカメラ条件及びレンズ条件の少なくとも一方に対し、照明条件と同様に行っても良い。
例えば、カメラ条件の機械学習であれば、機械学習プログラム54を実行する制御手段12は、撮像距離、露光時間、及びゲインの内の少なくとも何れかと、検査用合成画像Eとを状態変数として状態観測部60により観測し、学習部62において、特定の異常発生判定時に、その判定に係る撮像距離、露光時間、及びゲインの内の少なくとも何れかに対して報酬を付与することにより、行動価値関数を更新しても良い。
Further, machine learning may be performed in the same manner as the illumination condition for conditions other than the illumination condition in the lens appearance inspection, for example, at least one of the camera condition and the lens condition which are other inspection conditions.
For example, in the case of machine learning of camera conditions, the control means 12 that executes the machine learning program 54 observes the state using at least one of the imaging distance, the exposure time, and the gain and the composite image E for inspection as state variables. The action value function is generated by observing by the unit 60 and giving a reward to at least one of the imaging distance, the exposure time, and the gain related to the determination at the time of determining the occurrence of a specific abnormality in the learning unit 62. You may update it.

1・・レンズ外観検査装置、2・・エンクロージャ、7・・狭角光照射手段(照明光照射手段)、8・・カメラ、12・・制御手段、20・・リフト(撮像距離調整手段)、22・・ベース(照明光照射手段の位置変更に係る照射変更手段)、24・・狭角光LED、25・・レール(照明光照射手段の位置変更に係る照射変更手段)、27・・傾斜角調節手段(照明光照射手段の傾斜角変更に係る照射変更手段)、36・・カメラレンズ(物体側テレセントリックレンズ又は両側テレセントリックレンズ)、54・・機械学習プログラム(機械学習装置)、60・・状態観測部、62・・学習部、72・・報酬計算部、74・・関数更新部、C1〜C4・・第1〜第4検査用画像、D1〜D4・・第1〜第4検査用マスク画像、E・・検査用合成画像、L・・眼鏡レンズ(検査対象レンズ)、M1〜M4・・第1〜第4照明部分、N1〜N4・・第1〜第4画像部分(映り込み部分含有)、S7・・一部消去処理、S9・・合成処理。 1 ... Lens appearance inspection device, 2 ... Enclosure, 7 ... Narrow angle light irradiation means (illumination light irradiation means), 8 ... Camera, 12 ... Control means, 20 ... Lift (imaging distance adjustment means), 22 ... Base (irradiation changing means related to position change of illumination light irradiation means), 24 ... narrow angle light LED, 25 ... rail (irradiation changing means related to position change of illumination light irradiation means), 27 ... tilt Angle adjusting means (irradiation changing means related to changing the tilt angle of the illumination light irradiation means), 36 ... Camera lens (object side telecentric lens or bilateral telecentric lens), 54 ... Machine learning program (machine learning device), 60 ... State observation unit, 62 ... learning unit, 72 ... reward calculation unit, 74 ... function update unit, C1 to C4 ... images for 1st to 4th inspections, D1 to D4 ... for 1st to 4th inspections Mask image, E ... composite image for inspection, L ... spectacle lens (lens to be inspected), M1 to M4 ... 1st to 4th illumination parts, N1 to N4 ... 1st to 4th image parts (reflection) Partially contained), S7 ... Partial erasure processing, S9 ... Synthesis processing.

Claims (10)

検査対象レンズに対して照明光を照射可能な照明光照射手段と、
前記検査対象レンズが含まれる検査用画像を撮像するカメラと、
前記照明光照射手段による前記照明光の照射についての照明条件、及び前記カメラによる前記検査用画像の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習手段と、
を備えており、
前記機械学習手段は、
前記照明条件及び前記カメラ条件の少なくとも何れかと、前記検査用画像における異常判定の状態とに係る状態変数を観測する状態観測部と、
前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定する関数を更新することによって、前記照明条件及び前記カメラ条件の少なくとも何れかを決定することを学習する学習部と、
を有しており、
前記学習部は、
前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部と、
前記報酬計算部により計算された報酬に基づいて、前記関数を更新する関数更新部と、
を有しており、
前記関数更新部による前記関数の更新を繰り返すことによって、前記報酬が最も多く得られる前記照明条件及び前記カメラ条件の少なくとも何れかを学習する
ことを特徴とするレンズ外観検査装置。
Illumination light irradiation means capable of irradiating the lens to be inspected with illumination light,
A camera that captures an inspection image that includes the lens to be inspected,
A machine learning means for machine learning to determine at least one of an illumination condition for irradiating the illumination light by the illumination light irradiation means and a camera condition for capturing the inspection image by the camera.
Is equipped with
The machine learning means
A state observing unit that observes state variables related to at least one of the lighting conditions and the camera conditions, and the state of abnormality determination in the inspection image.
A learning unit that learns to determine at least one of the lighting condition and the camera condition by updating a function that determines at least one of the lighting condition and the camera condition based on the state variable.
Have and
The learning unit
A reward calculation unit that calculates a reward for the result of determining at least one of the lighting condition and the camera condition based on the state variable.
A function update unit that updates the function based on the reward calculated by the reward calculation unit,
Have and
A lens visual inspection apparatus comprising learning at least one of the illumination condition and the camera condition from which the reward is most obtained by repeating the update of the function by the function update unit.
前記照明光照射手段は、前記検査対象レンズに対する前記照明光の照明角度及び照明高さの少なくとも一方を相対的に変更可能であり、
前記照明条件は、前記照明角度及び前記照明高さの少なくとも一方を含む
ことを特徴とする請求項1に記載のレンズ外観検査装置。
The illumination light irradiation means can relatively change at least one of the illumination angle and the illumination height of the illumination light with respect to the lens to be inspected.
The lens appearance inspection apparatus according to claim 1, wherein the illumination condition includes at least one of the illumination angle and the illumination height.
前記検査対象レンズと前記カメラとの間の距離である撮像距離を調整する撮像距離調整手段を備えており、
前記カメラ条件は、前記撮像距離、露光時間、及びゲインの内の少なくとも何れかを含む
ことを特徴とする請求項1又は請求項2に記載のレンズ外観検査装置。
It is provided with an imaging distance adjusting means for adjusting an imaging distance, which is the distance between the lens to be inspected and the camera.
The lens appearance inspection apparatus according to claim 1 or 2, wherein the camera condition includes at least one of the imaging distance, the exposure time, and the gain.
前記検査用画像を処理する制御手段を備えており、
前記照明光照射手段は、前記検査対象レンズの光軸を囲む囲み線の一部にそれぞれ相当する部分を占める複数の照明部分から、前記照明光を切替えて照射可能であり、
前記カメラは、前記照明光照射手段による複数の前記照明部分における照射毎に前記検査用画像を撮像し、
前記制御手段は、
複数の前記照明部分の照射毎に撮像した前記検査用画像中の前記検査対象レンズの撮像部分における、前記照明部分が映り込んだ部分をそれぞれ消去して、複数の検査用マスク画像を生成する一部消去処理と、
複数の前記検査用マスク画像を合成して検査用合成画像を生成する合成処理と、
を行う
ことを特徴とする請求項1ないし請求項3の何れかに記載のレンズ外観検査装置。
It is provided with a control means for processing the inspection image.
The illumination light irradiating means can switch and irradiate the illumination light from a plurality of illumination portions occupying a portion corresponding to a part of the enclosing line surrounding the optical axis of the lens to be inspected.
The camera captures the inspection image for each irradiation in the plurality of illumination portions by the illumination light irradiation means.
The control means
A plurality of inspection mask images are generated by erasing each of the imaged portions of the inspection target lens in the inspection image taken for each irradiation of the plurality of illumination portions, in which the illumination portion is reflected. Part erasing process and
A compositing process that synthesizes a plurality of the inspection mask images to generate an inspection composite image, and
The lens appearance inspection apparatus according to any one of claims 1 to 3, wherein the lens visual inspection apparatus is performed.
前記照明光照射手段における前記囲み線は、前記検査対象レンズを囲む円環又は正多角形であり、
前記照明光照射手段における前記照明部分は、前記円環又は前記正多角形を均等に分割した場合の前記円環の部分又は前記正多角形の部分であり、
前記制御手段の前記一部消去処理における消去対象部分は、前記検査用画像をその中心から発する放射方向の直線で均等に分割した場合の前記検査用画像の部分である
ことを特徴とする請求項4に記載のレンズ外観検査装置。
The enclosing line in the illumination light irradiation means is a ring or a regular polygon surrounding the lens to be inspected.
The illumination portion in the illumination light irradiation means is a portion of the ring or a portion of the regular polygon when the ring or the regular polygon is evenly divided.
The claim is characterized in that the portion to be erased in the partial erasing process of the control means is a portion of the inspection image when the inspection image is evenly divided by a straight line in the radial direction emanating from the center thereof. 4. The lens visual inspection apparatus according to 4.
前記照明光は、指向角が30°以下の狭角光である
ことを特徴とする請求項1ないし請求項5の何れかに記載のレンズ外観検査装置。
The lens appearance inspection device according to any one of claims 1 to 5, wherein the illumination light is a narrow-angle light having a directivity angle of 30 ° or less.
前記カメラは、前記検査対象レンズに向けられたカメラレンズを有しており、
前記カメラレンズは、物体側テレセントリックレンズ又は両側テレセントリックレンズである
ことを特徴とする請求項1ないし請求項6の何れかに記載のレンズ外観検査装置。
The camera has a camera lens directed at the lens to be inspected.
The lens appearance inspection device according to any one of claims 1 to 6, wherein the camera lens is an object-side telecentric lens or a double-sided telecentric lens.
内面が反射防止面とされている箱体を備えており、
前記箱体は、孔を有しており、前記検査対象レンズを挟んで前記カメラと反対側に前記孔が位置するように配置されている
ことを特徴とする請求項1ないし請求項7の何れかに記載のレンズ外観検査装置。
It has a box body whose inner surface is an anti-reflection surface.
7. The lens appearance inspection device described in Crab.
前記検査対象レンズ及び前記照明光照射手段、並びに、前記カメラを覆うエンクロージャを備えており、
前記エンクロージャの内面は、前記照明光の反射が防止される反射防止面とされている
ことを特徴とする請求項1ないし請求項8の何れかに記載のレンズ外観検査装置。
The lens to be inspected, the illumination light irradiation means, and the enclosure covering the camera are provided.
The lens appearance inspection device according to any one of claims 1 to 8, wherein the inner surface of the enclosure is an antireflection surface that prevents reflection of the illumination light.
検査対象レンズに対する照明光の照射についての照明条件、及びカメラによる検査用画像の撮像についてのカメラ条件の少なくとも何れかを決定することを機械学習する機械学習装置であって、
前記照明条件及び前記カメラ条件の少なくとも何れかと、前記検査用画像における異常判定の状態とに係る状態変数を観測する状態観測部と、
前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定する関数を更新することによって、前記照明条件及び前記カメラ条件の少なくとも何れかを決定することを学習する学習部と、
を有しており、
前記学習部は、
前記状態変数に基づいて、前記照明条件及び前記カメラ条件の少なくとも何れかを決定した結果に対する報酬を計算する報酬計算部と、
前記報酬計算部により計算された報酬に基づいて、前記関数を更新する関数更新部と、
を有しており、
前記関数更新部による前記関数の更新を繰り返すことによって、前記報酬が最も多く得られる前記照明条件及び前記カメラ条件の少なくとも何れかを学習する
ことを特徴とする機械学習装置。
A machine learning device that machine-learns to determine at least one of the illumination conditions for irradiating the lens to be inspected with illumination light and the camera conditions for capturing an image for inspection by the camera.
A state observing unit that observes state variables related to at least one of the lighting conditions and the camera conditions, and the state of abnormality determination in the inspection image.
A learning unit that learns to determine at least one of the lighting condition and the camera condition by updating a function that determines at least one of the lighting condition and the camera condition based on the state variable.
Have and
The learning unit
A reward calculation unit that calculates a reward for the result of determining at least one of the lighting condition and the camera condition based on the state variable.
A function update unit that updates the function based on the reward calculated by the reward calculation unit,
Have and
A machine learning device characterized in that by repeating the update of the function by the function update unit, at least one of the lighting condition and the camera condition from which the reward is most obtained is learned.
JP2020077654A 2020-04-24 2020-04-24 Lens visual inspection device and machine learning device Pending JP2021173644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020077654A JP2021173644A (en) 2020-04-24 2020-04-24 Lens visual inspection device and machine learning device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020077654A JP2021173644A (en) 2020-04-24 2020-04-24 Lens visual inspection device and machine learning device

Publications (1)

Publication Number Publication Date
JP2021173644A true JP2021173644A (en) 2021-11-01

Family

ID=78278313

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020077654A Pending JP2021173644A (en) 2020-04-24 2020-04-24 Lens visual inspection device and machine learning device

Country Status (1)

Country Link
JP (1) JP2021173644A (en)

Similar Documents

Publication Publication Date Title
US9888839B2 (en) Methods and apparatuses for determining contact lens intolerance in contact lens wearer patients based on dry eye tear film characteristic analysis and dry eye symptoms
US11663703B2 (en) System, method and apparatus for macroscopic inspection of reflective specimens
CN109642848B (en) Image inspection apparatus and image inspection method
US20130293842A1 (en) Optical phantoms for use with ocular surface interferometry (osi) devices and systems configured to measure tear film layer thickness(es), and related use for calibration
CN110058480A (en) Lighting device
CN110100173A (en) System and method for detecting inclusion in jewel
JP6859628B2 (en) Visual inspection method and visual inspection equipment
JP6829828B2 (en) Lens appearance inspection device
JP2005070025A (en) Light source testing system and method
JP2004028930A (en) Device and method for detecting foreign matter in container
WO2004065903A1 (en) Inspection device for mouth of container
JP2021173644A (en) Lens visual inspection device and machine learning device
US11961210B2 (en) System, method and apparatus for macroscopic inspection of reflective specimens
JP6973783B2 (en) Lens appearance inspection device
JP2008003063A (en) Shading correction method, defect detection method, and defect detector and control method program thereof
CN114930158A (en) Laser-based inclusion detection system and method
KR101153246B1 (en) Substrate inspection method
WO2023287992A1 (en) System, method and apparatus for macroscopic inspection of reflective specimens
JP6746057B2 (en) Lens visual inspection device
JPH0862155A (en) Object 0bserving apparatus
TWI839774B (en) System, method and apparatus for macroscopic inspection of reflective specimens
JP2016118518A (en) Appearance inspection device
KR101032090B1 (en) Substrate inspection method
JP7188821B1 (en) inspection system
TWI839547B (en) System, method and apparatus for macroscopic inspection of reflective specimens

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20231024

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20240416