TWI792291B - Method of automatically setting optical parameters and automated optical inspection system using the same - Google Patents
Method of automatically setting optical parameters and automated optical inspection system using the same Download PDFInfo
- Publication number
- TWI792291B TWI792291B TW110115481A TW110115481A TWI792291B TW I792291 B TWI792291 B TW I792291B TW 110115481 A TW110115481 A TW 110115481A TW 110115481 A TW110115481 A TW 110115481A TW I792291 B TWI792291 B TW I792291B
- Authority
- TW
- Taiwan
- Prior art keywords
- optical parameter
- recommended
- optical
- error
- module
- Prior art date
Links
Images
Abstract
Description
本揭露有關於一種光學參數自動設定方法及應用其之自動光學檢測系統。 The disclosure relates to a method for automatically setting optical parameters and an automatic optical inspection system using the method.
光學檢測系統可對產品拍攝,以取得產品(待測物)之影像,並經由分析影像,以檢測產品的缺陷。為了提高檢測準確度,自動光學檢測系統所擷取的影像須具有適當或最佳的色彩資訊,因此需要視環境或檢測之產品調整光學檢測系統的光學參數。目前的光學參數設定主要是由專家根據經驗現場調整光學檢測系統的光學參數。 The optical inspection system can take pictures of the product to obtain the image of the product (object to be tested), and analyze the image to detect product defects. In order to improve the detection accuracy, the image captured by the automatic optical inspection system must have appropriate or optimal color information, so it is necessary to adjust the optical parameters of the optical inspection system according to the environment or the product to be inspected. The current optical parameter setting is mainly to adjust the optical parameters of the optical detection system on the spot by experts according to experience.
然而,現場專家依經驗調整光學參數存在誤判的風險,此外不同的專家的判斷與設定之光學參數通常不完全相同,如此可能造成品質管控不穩定的情況。另一方面,在光學參數項目數量龐大的情況下,由專家人工調整光學參數相當耗時,可能降低生產速度與效能。 However, there is a risk of misjudgment when on-site experts adjust optical parameters based on experience. In addition, the judgments of different experts are usually not exactly the same as the optical parameters set, which may lead to unstable quality control. On the other hand, in the case of a large number of optical parameter items, manual adjustment of optical parameters by experts is quite time-consuming, which may reduce production speed and efficiency.
本揭露係有關於一種光學參數自動設定方法及應用其之自動光學檢測系統。 The present disclosure relates to a method for automatically setting optical parameters and an automatic optical inspection system using the method.
根據本揭露之一實施例,提出一種光學參數自動設定方法。光學參數自動設定方法適用於一自動光學檢測(Automated Optical Inspection,AOI)系統。自動光學檢測系統包括一攝像模組、一誤差運算模組、一自動設定模組及一光學參數推薦模組。光學參數自動設定方法包括以下步驟:攝像模組在自動光學檢測系統被用一第一推薦光學參數組設定對一待測物取像,以取得一推薦待測物影像;誤差運算模組依據一優化誤差函數,對一待測物標準圖與推薦待測物影像執行運算,以取得待測物標準圖與推薦待測物影像之間的一推薦誤差值;誤差運算模組判斷推薦誤差值是否收斂。當判斷推薦誤差值未收斂時,光學參數推薦模組依據推薦誤差值及第一推薦光學參數組執行運算,而取得一第二推薦光學參數組,並且自動設定模組依據第二推薦光學參數組設定自動光學檢測系統;以及,當判斷推薦誤差值收斂時,誤差運算模組決定第一推薦光學參數組為自動光學檢測系統之一最佳光學參數組。 According to an embodiment of the present disclosure, a method for automatically setting optical parameters is proposed. The method for automatically setting optical parameters is suitable for an Automated Optical Inspection (AOI) system. The automatic optical inspection system includes a camera module, an error calculation module, an automatic setting module and an optical parameter recommendation module. The method for automatically setting optical parameters includes the following steps: the camera module is set to use a first recommended optical parameter set in the automatic optical inspection system to capture an image of an object to be measured to obtain a recommended image of the object to be measured; the error calculation module is based on a Optimizing the error function, performing calculations on a standard image of the DUT and a recommended image of the DUT to obtain a recommended error value between the standard image of the DUT and the recommended image of the UUT; the error calculation module determines whether the recommended error value is convergence. When it is judged that the recommended error value has not converged, the optical parameter recommendation module performs calculations based on the recommended error value and the first recommended optical parameter set to obtain a second recommended optical parameter set, and automatically sets the module based on the second recommended optical parameter set Setting the automatic optical inspection system; and, when judging that the recommended error values converge, the error calculation module determines that the first recommended optical parameter set is one of the best optical parameter sets of the automatic optical inspection system.
根據本揭露之另一實施例,提出一種自動光學檢測系統。自動光學檢測系統包括一攝像模組、一誤差運算模組、一光學參數推薦模組及一自動設定模組。攝像模組經配置以執行:在一推薦光學參數下對一待測物取像,以取得一推薦待測物影像。 誤差運算模組經配置以執行:依據一優化誤差函數,對一待測物標準圖與推薦待測物影像執行運算,以取得待測物標準圖與推薦待測物影像之間的一推薦誤差值;及,判斷推薦誤差值是否收斂。光學參數推薦模組經配置執行:當判斷推薦誤差值未收斂時,依據推薦誤差值及第一推薦光學參數組執行運算,而取得一第二推薦光學參數組。當判斷推薦誤差值收斂時,誤差運算模組更用以執行:決定推薦光學參數為自動光學檢測系統之一最佳光學參數組。 According to another embodiment of the present disclosure, an automatic optical inspection system is provided. The automatic optical detection system includes a camera module, an error calculation module, an optical parameter recommendation module and an automatic setting module. The camera module is configured to perform: taking an image of an object under test under a recommended optical parameter, so as to obtain a recommended image of the object under test. The error calculation module is configured to execute: perform an operation on a standard image of the DUT and a recommended image of the DUT according to an optimized error function, so as to obtain a recommended error between the standard image of the DUT and the recommended image of the DUT and, judging whether the recommended error value is convergent. The optical parameter recommendation module is configured to execute: when it is judged that the recommended error value has not converged, the operation is performed according to the recommended error value and the first recommended optical parameter set to obtain a second recommended optical parameter set. When it is judged that the recommended error value converges, the error calculation module is further used to execute: determine the recommended optical parameter as one of the best optical parameter sets of the automatic optical inspection system.
為了對本揭露之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下: In order to have a better understanding of the above and other aspects of the present disclosure, the following specific embodiments are described in detail in conjunction with the attached drawings as follows:
100:自動光學檢測系統 100: Automatic Optical Inspection System
110:優化模組 110:Optimize the module
120:誤差運算模組 120: Error calculation module
130:光學參數推薦模組 130: Optical parameter recommendation module
140:攝像模組 140: Camera module
150:自動設定模組 150: Automatic setting module
160:光源模組 160:Light source module
C1~C3:曲線 C1~C3: curve
D1,D2:資料庫 D1, D2: database
F1:訓練標準圖 F1: Training standard map
F2:待測物標準圖 F2: Standard diagram of the object to be tested
f:誤差運算函數 f: error operation function
fmin:最小誤差值 f min : minimum error value
E:期望值分析函數 E: Expected value analysis function
EF:優化誤差函數 EF: Optimizing the Error Function
ET1,ET2,ET3,ETm:初始誤差值 ET 1 , ET 2 , ET 3 , ET m : initial error value
ER1,ER2,ER3,ER4,ER5,ER6,ER7,ERn:推薦誤差值 ER 1 , ER 2 , ER 3 , ER 4 , ER 5 , ER 6 , ER 7 , ER n : recommended error value
MR1,MR2,MR3,MR4,MR5,MR6,MR7,MRn:推薦待測物影像 MR 1 , MR 2 , MR 3 , MR 4 , MR 5 , MR 6 , MR 7 , MR n : recommended image of the object to be measured
M11S:專家標準影像 M11 S : Expert Standard Image
M12t:非專家標準影像 M12 t : non-expert standard image
MTm:初始待測物影像 MT m : Initial DUT image
PR1,PR2,PR3,PR4,PR5,PR6,PR7,PRn:推薦光學參數組 PR 1 , PR 2 , PR 3 , PR 4 , PR 5 , PR 6 , PR 7 , PR n : recommended optical parameter set
PT1,PT2,PT3,PTm:初始光學參數組 PT 1 , PT 2 , PT 3 , PT m : initial optical parameter group
U1s,U2,U2t,V1,V2,W1t:向量 U1 s , U2, U2 t , V1, V2, W1 t : vector
S110~S190:步驟 S110~S190: steps
Λ,:優化權重 Λ, : optimize weight
xRj:候選光學參數組 xR j : candidate optical parameter set
xTi:已選光學參數組 xT i : selected optical parameter group
x(1),x(2),x(3),x(k),x(P):光學參數類型 x (1) ,x (2) ,x (3) ,x (k) ,x (P) : optical parameter type
Corr(xTi,xRj):差距 Corr(xT i ,xR j ): gap
Φ(xRj):期望值 Φ(xR j ): expected value
第1圖繪示依照本揭露一實施例之自動光學檢測系統之示意圖。 FIG. 1 shows a schematic diagram of an automatic optical inspection system according to an embodiment of the present disclosure.
第2A及2B圖繪示第1圖之自動光學檢測系統的光學參數自動設定方法的流程圖。 2A and 2B are flowcharts showing the automatic optical parameter setting method of the automatic optical inspection system in FIG. 1 .
第3A(a)~3H(b)圖繪示第2A及2B圖之推薦光學參數的取得過程示意圖。 Figures 3A(a)~3H(b) illustrate the process of obtaining the recommended optical parameters in Figures 2A and 2B.
請參照第1~2及3A(a)~3H(b)圖,第1圖繪示依照本揭露一實施例之自動光學檢測(Automated Optical Inspection,AOI)系統100之示意圖,第2A及2B圖繪示第1圖之自動光學檢測系統100
的光學參數自動設定方法的流程圖,而第3A(a)~3H(b)圖繪示第2A及2B圖之推薦光學參數PRn的取得過程示意圖。
Please refer to Figures 1-2 and 3A(a)-3H(b), Figure 1 shows a schematic diagram of an automated optical inspection (Automated Optical Inspection, AOI)
如第1圖所示,自動光學檢測系統100包括優化模組110、誤差運算模組120、光學參數推薦模組130、攝像模組140、自動設定模組150及光源模組160。攝像模組140例如是光學攝影機或線性光學掃描器。光源模組160例如是包含至少一光源(未繪示)。優化模組110、誤差運算模組120、光學參數推薦模組130與自動設定模組150之至少一者例如是採用半導體製程所形成的實體電路(circuit),或為韌體而藉由一運算處理器來完成。此外,優化模組110、誤差運算模組120、光學參數推薦模組130與自動設定模組150之至少一者可整合成單一模組,或整合於一控制器(未繪示)或運算處理器(未繪示)中。
As shown in FIG. 1 , the automatic
如第1圖所示,攝像模組140在該自動光學檢測系統100被設定為推薦光學參數組PRn(例如,第3B圖之第一推薦光學參數組PR1)下,對待測物取像,以取得推薦待測物影像MRn。誤差運算模組120經配置以執行依據優化誤差函數EF,對待測物標準圖F2與推薦待測物影像MRn執行運算,以取得待測物標準圖F2與推薦待測物影像MRn之間的推薦誤差值ERn。接著,誤差運算模組120判斷推薦誤差值ERn是否收斂。當判斷推薦誤差值ERn收斂時,誤差運算模組120決定推薦光學參數組PRn(例如,第3B圖之第一推薦光學參數組PR1)為自動光學檢測系統100之最佳光學參數組;當誤差運算模組120判斷推薦誤差值ERn未收斂時,光學
參數推薦模組130經配置以執行依據推薦誤差值ERn及第一推薦光學參數組PRn執行運算,而取得另一推薦光學參數組PRn+1(例如,第3E圖之第二推薦光學參數組PR2)。如此,自動光學檢測系統100可自動取得最佳光學參數組,改善習知人工調光的問題。
As shown in FIG. 1, the camera module 140 captures an image of the object under the condition that the automatic
本文的「光學參數組」例如是包含至少一光學參數類型,如x(1)、x(2)、x(3)、...、x(P)等P種參數類型,其中x(1)、x(2)、x(3)、...、x(P)可分別表示不同的光學參數類型,如光源模組160的光源參數及/或攝像模組140的攝像參數,其中光源參數例如是照射光的色溫、亮度、發光角、發光時間及/或照射角度等的光學參數類型,而攝像參數例如是攝像模組的曝光時間等的光學參數類型。P表示光學參數類型的數量,本揭露實施例不限定P的最大值。在本實施例中,光學參數類型係以二個為例說明,如x(1)及x(2),例如是分別為攝像模組的曝光時間及光源模組的發光時間。光源模組160之照明模式可由自動設定模組150依據推薦光學參數組PRn的相關光學參數類型執行設定,而攝像模組140之攝像模式可由自動設定模組150依據推薦光學參數組PRn的相關光學參數類型執行設定。光源模組160提供照明光給待測物(未繪示),而攝像模組140對待測物攝像,以取得待測物之推薦待測物影像。前述「待測物」例如是任何可透過AOI系統進行線上檢測(如,缺陷檢測、產品種類檢測等)的產品,如半導體晶片、電路板等,然本揭露不限制待測物的種類。
The "optical parameter set" in this article, for example, includes at least one optical parameter type, such as x (1) , x (2) , x (3) , ..., x (P) and other P parameter types, where x (1 ) , x (2) , x (3) , ..., x (P) can respectively represent different optical parameter types, such as the light source parameters of the
以下係以第2A及2B圖之流程圖進一步說明本揭露實施例之自動光學檢測系統100的光學參數自動設定方法。
The following is a further description of the automatic optical parameter setting method of the automatic
在步驟S110中,取得優化誤差函數EF。本實施例的優化誤差函數EF是由優化模組110運算取得(如第1圖所示)。然而在其他實施方式中,優化誤差函數EF可在線下或離線執行運算來事先取得,因此自動光學檢測系統可不包含優化模組。 In step S110, an optimized error function EF is obtained. The optimization error function EF of this embodiment is obtained through the operation of the optimization module 110 (as shown in FIG. 1 ). However, in other implementations, the optimization error function EF can be obtained in advance by performing calculations offline or offline, so the automatic optical inspection system may not include an optimization module.
在步驟S110中,優化模組110對訓練標準圖F1(繪示於第1圖)、至少一專家標準影像M11S(繪示於第1圖)及至少一非專家標準影像M12t(繪示於第1圖)執行運算,而取得優化誤差函數EF,其中S為等於或大於1的正整數,S之最大值視專家標準影像M11S的總數而定,本揭露實施例不加以限定,而t為等於或大於1的正整數,t之最大值視非專家標準影像M11t的總數而定,本揭露實施例不加以限定。訓練標準圖F1的數量例如是1個,專家標準影像M11S的數量可以是至少一個。每個專家可從數張影像中,挑選出一張與訓練標準圖F1最接近的影像(例如可以是色溫、亮度等各種色彩資訊方面最接近者),並將各個專家所選出的影像定義為「專家標準影像」,其餘未被選取得的影像定義為「非專家標準影像」。本揭露實施例不限定專家標準影像M11S的數量以及非專家標準影像M12t的數量。如第1圖所示,訓練標準圖F1、專家標準影像M11S及非專家標準影像M12t可儲存於第一資料庫D1,而待測物標準圖F2可儲存於第二資料庫D2。第一資料庫D1與第二資
料庫D2至少一者可隸屬於自動光學檢測系統100,然本揭露實施例不受此限。
In step S110, the
在一實施例中,優化模組110以最小化訓練標準圖F1與專家標準影像M11S之間的誤差以及非最小化訓練標準圖F1與非專家標準影像M12t之間的誤差為目標,取得優化誤差函數EF的優化權重Λ。例如,優化模組110以訓練標準圖F1與專家標準影像M11S之間的目標誤差TE1設為0(如下式(1))以及訓練標準圖F1與非專家標準影像M12t之間的目標誤差TE2設為1(如下式(2))為目標,取得優化誤差函數EF的優化權重Λ(如下式(3))。式(1)及(2)的誤差運算函數f可採用各種誤差分析技術或數學方法對誤差運算函數f內的向量進行誤差分析,例如運算加權歐氏距離或馬氏距離,本揭露實施例在此不加以限制。
In one embodiment, the
f(V1,U1s|Λ)=TE1...(1) f(V1 , U1 s |Λ)=TE1...(1)
f(V1,W1s|Λ)=TE2...(2) f(V1 , W1 s |Λ)=TE2...(2)
e=Σ S (f(V1,U1s|Λ))2+Σ t (1-f(V1,W1s|Λ))2...(3) e=Σ S (f(V1 , U1 s |Λ)) 2 +Σ t (1-f(V1 , W1 s |Λ)) 2 ...(3)
在式(1),向量V1例如是訓練標準圖F1的像素層級的特徵向量,向量U1S例如是第S張專家標準影像M11S的像素層級的特徵向量。在式(2),向量W1t例如是第t張非專家標準影像M12t的像素層級的特徵向量。在式(3),e為總誤差值,其運算目標是在所有專家標準影像之誤差值與所有非專家標準影像之誤差值之加總為0或接近0下取得優化權重Λ。如式(4)所示,優化模組
110可採用argmin的數學方式,對優化權重Λ進行優化處理。例如,優化模組110可決定最小的總誤差值e所對應的優化權重Λ為最佳優化權重。最佳優化權重例如是包含至少一常數,亦可以是包含多個常數的矩陣。本實施例中,向量V1、向量U1S、向量W1t為像素層級的特徵向量,例如表示RGB或HSV(色相、飽和度、明度),然而在其他實施方式中,向量V1、向量U1S、向量W1t也可以是圖像層級的特徵向量,例如深度學習模型抽取出來的特徵向量。
In formula (1), the vector V1 is, for example, the feature vector at the pixel level of the training standard image F1, and the vector U1 S is, for example, the feature vector at the pixel level of the S-th expert standard image M11 S. In formula (2), the vector W1 t is, for example, a pixel-level feature vector of the t-th non-expert standard image M12 t . In formula (3), e is the total error value, and its calculation goal is to obtain the optimal weight Λ when the sum of the error values of all expert standard images and the error values of all non-expert standard images is 0 or close to 0. As shown in formula (4), the
在取得最佳優化權重後,即可依據最佳優化權重來建構優化誤差函數EF,如下式(5)。在式(5)中,向量V2為標準圖例如待測物標準圖)的像素層級的特徵向量,向量U2為待測物影像例如初始待測物影像及/或推薦待測物影像)的像素層級的特徵向量。本實施例中,向量V2及向量U2為像素層級的特徵向量,例如表示RGB或HSV(色相、飽和度、明度),然而在其他實施方式中,向量V2及向量U2也可以是圖像層級的特徵向量,例如深度學習模型抽取出來的特徵向量。 In obtaining the optimal optimization weight After that, the weights can be optimized according to the best To construct the optimization error function EF, the following formula (5). In the formula (5), the vector V2 is the feature vector of the pixel level of the standard image (such as the standard image of the UUT), and the vector U2 is the pixel of the image of the UUT (such as the initial image of the UUT and/or the recommended image of the UUT) Hierarchy feature vectors. In this embodiment, the vector V2 and the vector U2 are feature vectors at the pixel level, such as representing RGB or HSV (hue, saturation, lightness), but in other implementations, the vector V2 and the vector U2 can also be at the image level Feature vectors, such as feature vectors extracted from deep learning models.
在將向量V2及向量U2代入式(5)後,依據優化誤差函數EF運算向量V2及向量U2間之誤差值(例如初始誤差值及/或推薦誤差值),其中誤差值表示待測物影像與標準圖F2的差異,誤差值愈小,表示向量V2及向量U2之間的差異愈小(例如圖像在色彩資訊上愈接近);反之則愈大。 After substituting vector V2 and vector U2 into formula (5), calculate the error value between vector V2 and vector U2 (such as initial error value and/or recommended error value) according to the optimized error function EF, where the error value represents the image of the object under test For the difference with the standard image F2, the smaller the error value, the smaller the difference between the vector V2 and the vector U2 (for example, the closer the image is in terms of color information); otherwise, the larger.
在取得優化誤差函數EF後,可執行步驟S120~S190來決定光學參數組以自動設定光學參數。為了清楚說明,在本實施例之光學參數自動方法的步驟S120~S190是用以決定光學參數組,光學參數組以包含二光學參數類型為例說明,如x(1)、x(2)。在一實施例中,決定光學參數組的方法(如步驟S120~S190)是在x(1)為固定值的情況下決定x(2)(如,第3A(a)~3H(b)圖之座標橫軸)。在另一實施例中,決定光學參數組的方法(如步驟S120~S190)係在x(1)及x(2)皆為可變的情況決定x(1)及x(2)。在其它實施例中,光學參數組可包含P個光學參數類型x(1)、x(2)、x(3)、...、x(P),決定光學參數組的方法係在x(1)、x(2)、x(3)、...、x(P)之至少一者的值變動下進行。 After obtaining the optimized error function EF, steps S120˜S190 may be performed to determine the optical parameter set to automatically set the optical parameters. For clarity, the steps S120-S190 of the optical parameter automatic method in this embodiment are used to determine the optical parameter set, and the optical parameter set is illustrated as including two types of optical parameters, such as x (1) and x (2) . In one embodiment, the method for determining the optical parameter set (such as steps S120-S190) is to determine x (2) when x (1) is a fixed value (such as, Figs. 3A(a)-3H(b) coordinates on the horizontal axis). In another embodiment, the method for determining the optical parameter set (such as steps S120-S190) is to determine x (1) and x (2) when both x (1) and x (2) are variable. In other embodiments, the optical parameter set may include P optical parameter types x (1) , x (2) , x (3) , ..., x (P) , and the method for determining the optical parameter set is based on x ( 1) , x (2) , x (3) , ..., x (P) are varied in value.
在步驟S120中,自動光學檢測系統100可依據優化誤差函數EF,對待測物標準圖F2與M個初始待測物影像MTm進行運算,而取得第1個推薦光學參數組。符號MTm的下標m表示第m個初始待測物影像,其中m為介於1~M的正整數,M為初始待測物影像的總數量,本揭露實施例不限定M的最大值。
In step S120 , the automatic
步驟S120可包含步驟S121~S123。 Step S120 may include steps S121-S123.
在步驟S121中,攝像模組140在自動光學檢測系統100被用M個初始光學參數組PTm設定的情況下,分別取得M個初始待測物影像MTm,亦在自動光學檢測系統100被用初始光學參數組PT1設定的情況下,攝像模組140對待測物執行取像以取得初始待測物影像MT1;接著,在自動光學檢測系統100被用初始光學參數組PT2設定的情況下,攝像模組140取得初始待測物影像MT2,如此自動光
學檢測系統100是被用M個初始光學參數組PTm逐次設定,並攝像模組140逐次執行取像而取得M個初始待測物影像MTm。初始光學參數組PTm包含的光學參數類型本揭露實施例不加以限定。如第3A(a)圖所示,本揭露實施例的初始光學參數組PTm以三個為例(即M=3的情況)說明,分別是初始光學參數組PT1、PT2及PT3。初始光學參數組PT1、PT2及PT3可分別表示成PT1[x(1),x(2)]、PT2[x(1),x(2)]及PT3[x(1),x(2)],其餘光學參數組具有類似表達形式,於此不再贅述。
In step S121, when the automatic
在步驟S122中,誤差運算模組120依據優化誤差函數EF,對待測物標準圖F2與M個初始待測物影像MTm執行運算,而分別取得M個初始待測物影像MTm分別與待測物標準圖F2之間的M個初始誤差值ETm,其中m為介於1~M的正整數。如第3A(a)圖所示,本揭露實施例的初始誤差值ETm以三個(即,M=3的情況)為例說明,分別是初始誤差值ER1、ER2及ER3。 In step S122, the error operation module 120 performs calculations on the standard image F2 of the object to be measured and the M initial images MT m of the object to be measured according to the optimized error function EF, and respectively obtains the M initial images MT m of the object to be measured and the images MT m to be measured respectively. M initial error values ET m between the standard graphs F2 of the measured object, where m is a positive integer ranging from 1 to M. As shown in FIG. 3A(a), three initial error values ET m in the embodiment of the present disclosure (ie, the case of M=3) are illustrated as examples, which are the initial error values ER 1 , ER 2 and ER 3 .
第3A(a)圖之曲線C1表示第0次疊代中光學參數組與誤差值的對應關係,第3A(b)圖的各點表示不同疊代次數與第0次疊代結果之曲線C1中的數個誤差值中最小者(稱「最小誤差值」)的對應關係,第3B~3H(b)圖具有相似的定義,於此不再說明。光學參數自動設定方法在第3A(b)圖所示的階段中,推薦光學參數組PRn尚未被引進運算(尚未執行步驟S140~S180的疊代流程),因此最小誤差值對應的疊代次為0。 Curve C1 in Figure 3A(a) represents the corresponding relationship between the optical parameter set and the error value in the 0th iteration, and each point in Figure 3A(b) represents the curve C1 between different iterations and the result of the 0th iteration Figures 3B~3H(b) have similar definitions for the smallest of several error values in (called "minimum error value"), and will not be described here. In the stage shown in Figure 3A(b) of the method for automatic setting of optical parameters, the recommended optical parameter set PR n has not yet been introduced into the calculation (the iterative process of steps S140~S180 has not yet been executed), so the iteration times corresponding to the minimum error value is 0.
在步驟S123中,光學參數推薦模組130依據M個初始誤差值ETm及M個初始光學參數組PTm執行運算,而取得第1個推薦光學參數組PR1。 In step S123 , the optical parameter recommendation module 130 performs calculations according to the M initial error values ET m and the M initial optical parameter sets PT m to obtain the first recommended optical parameter set PR 1 .
光學參數自動設定方法中,光學參數推薦模組130可利用多種實施方式來決定推薦光學參數組,例如,光學參數推薦模組130可依據式(6)~(7),取得推薦光學參數組。然,只要能取得推薦光學參數組即可,本揭露實施例之推薦光學參數組的取得方式不限於使用式(6)~(7)。 In the optical parameter automatic setting method, the optical parameter recommendation module 130 can use various implementation methods to determine the recommended optical parameter set. For example, the optical parameter recommendation module 130 can obtain the recommended optical parameter set according to formulas (6)-(7). However, as long as the recommended optical parameter set can be obtained, the method of obtaining the recommended optical parameter set in the embodiment of the present disclosure is not limited to using formulas (6)-(7).
在式(6)、(7)中,xRj為候選光學參數組,其中j是介於1~J的正整數,用來表示xRj是第j個候選光學參數組,並且J為候選光學參數組的數量。xRj包含數個光學參數類型,可進一步以xRj[x(1)、x(2)、x(3)、...、x(P)]表示。候選光學參數組xRj可以是所有光學參數組中尚未用以執行運算取得誤差值者。本揭露實施例不限定J的最大值,其可視光學參數類型的數目及/或其數值範圍而定。 In formulas (6) and (7), xR j is the candidate optical parameter group, where j is a positive integer ranging from 1 to J, which is used to indicate that xR j is the jth candidate optical parameter group, and J is the candidate optical parameter group The number of parameter groups. xR j includes several types of optical parameters, which can be further represented by xR j [x (1) , x (2) , x (3) , . . . , x (P) ]. The candidate optical parameter set xR j may be one of all the optical parameter sets that has not been used to perform calculations to obtain error values. The embodiments of the present disclosure do not limit the maximum value of J, which may be determined by the number of optical parameter types and/or its value range.
在式(6)、(7)中,xTi為已選光學參數組,其中i為介於1~Q的正整數,用來表示xTi為第i個已選光學參數組,其中Q為已選光學參數組的數量。xTi包含數個光學參數類型,可進一步以 xTi[x(1)、x(2)、x(3)、...、x(P)]表示。已選光學參數組xTi包含已求得誤差值的初始光學參數組PTm及/或推薦光學參數組PRn。例如,以第3B圖(進入第1次疊代)來說,已選光學參數組xTi包含第3A(a)圖之初始光學參數組PT1、PT2及PT3(以實心圓點表示)。以第3D圖(進入第2次疊代)來說,已選光學參數組xTi包含第3C(a)圖之初始光學參數組PT1、PT2及PT3及推薦光學參數組PR1(以實心圓點表示)。在式(6)中,θ k 表示第k個光學參數類型x(k)的權重,其為常數,不同的數個光學參數類型x(k)的數個θ k 的值可相異或相同。此外,前述k為介於1~Q的正整數,其中Q為已選光學參數組xTi的數量。推薦光學參數組的數量隨疊代次而增加,亦即Q的值隨之增加,Q的最大值視疊代次數而定,本揭露實施例不限定Q的最大值。 In formulas (6) and (7), xT i is the selected optical parameter group, where i is a positive integer ranging from 1 to Q, which is used to indicate that xT i is the i-th selected optical parameter group, where Q is Number of selected optical parameter sets. xT i includes several types of optical parameters, which can be further represented by xT i [x (1) , x (2) , x (3) , . . . , x (P) ]. The selected optical parameter set xT i includes the initial optical parameter set PT m and/or the recommended optical parameter set PR n for which error values have been obtained. For example, in Figure 3B (entering the first iteration), the selected optical parameter set xT i includes the initial optical parameter sets PT 1 , PT 2 and PT 3 in Figure 3A(a) (represented by solid circles ). Taking Figure 3D (entering the second iteration), the selected optical parameter set xT i includes the initial optical parameter sets PT 1 , PT 2 and PT 3 in Figure 3C(a) and the recommended optical parameter set PR 1 ( are represented by solid dots). In formula (6), θ k represents the weight of the kth optical parameter type x (k) , which is a constant, and the values of several θ k of different optical parameter types x (k) can be different or the same . In addition, the aforementioned k is a positive integer ranging from 1 to Q, wherein Q is the number of selected optical parameter sets xT i . The number of recommended optical parameter sets increases with the number of iterations, that is, the value of Q increases accordingly, and the maximum value of Q depends on the number of iterations. The embodiments of the present disclosure do not limit the maximum value of Q.
在式(6)中,Corr(xTi,xRj)表示第j個候選光學參數組xRj相較於第i個已選光學參數組xTi的差距。在指數函數exp的運算中,當第j個候選光學參數組xRj與第i個已選光學參數組xTi xTi之間的差距愈大時,Corr(xTi,xRj)的數值愈小;反之則愈大。 In formula (6), Corr(xT i , xR j ) represents the difference between the j-th candidate optical parameter set xR j and the i-th selected optical parameter set xT i . In the operation of the exponential function exp, when the gap between the j-th candidate optical parameter set xR j and the i-th selected optical parameter set xT i x T i is larger, the value of Corr(xT i , xR j ) The smaller it is, the larger it will be.
在式(7)中,Φ(xRj)表示第j個候選光學參數組xRj相較於所有已選光學參數組xTi的第j個期望值(或機率),期望值Φ(xRj)的值例如是介於0~1之間。期望值分析函數E用以取得第j個候選光學參數組xRj相較於所有已選光學參數組xTi的期望值,其可採用各種統計或機率分析技術。Q表示所有已選光學參數組xTi的數目,例如,以第3B圖(執行第1次疊代)來說,已選光學參 數組xTi係3個(如,實心圓點的數量),即Q等於3;以第3D圖(進入第2次疊代)來說,已選光學參數組xTi係4個(如,實心圓點的數量),即Q等於4。 In formula (7), Φ(xR j ) represents the jth expected value (or probability) of the jth candidate optical parameter set xR j compared to all selected optical parameter sets xT i , and the expected value Φ(xR j ) The value of is, for example, between 0 and 1. The expected value analysis function E is used to obtain the expected value of the j-th candidate optical parameter set xR j compared to all selected optical parameter sets xT i , which can use various statistical or probabilistic analysis techniques. Q represents the number of all selected optical parameter sets xT i , for example, in the case of Figure 3B (executing the first iteration), the selected optical parameter sets xT i are 3 (such as the number of solid circles), That is, Q is equal to 3; in the case of the 3D diagram (entering the second iteration), the selected optical parameter set xT i is 4 (for example, the number of solid circles), that is, Q is equal to 4.
在式(7)中,fmin表示所有已選光學參數組xTi對應的所有誤差值中的最小者,例如,第3B圖(執行第1次疊代)中,fmin為當前疊代次最新的初始誤差值ET2(如第3A(b)圖所示);在第3D圖(執行第2次疊代)中,fmin為當前疊代次最新的最小誤差值,即第3C(b)圖最右邊的初始誤差值ET2(即,ET2為初始誤差值ET1~ET3中最小者);在第3F圖(執行第3次疊代)中,fmin為當前疊代次最新的最小誤差值,即第3E(b)圖最右邊的初始誤差值ET2(即,初始誤差值ET1~ET3與推薦誤差值ET1中最小者)。 In formula (7), f min represents the minimum of all error values corresponding to all selected optical parameter groups xT i , for example, in Figure 3B (executing the first iteration), f min is the current iteration The latest initial error value ET 2 (as shown in Figure 3A(b)); in Figure 3D (executing the second iteration), f min is the latest minimum error value of the current iteration, that is, the 3C ( b) The initial error value ET 2 on the far right of the figure (that is, ET 2 is the smallest of the initial error values ET 1 ~ ET 3 ); in figure 3F (executing the third iteration), f min is the current iteration The next latest minimum error value, that is, the initial error value ET 2 on the far right of Figure 3E(b) (ie, the smallest of the initial error values ET 1 ~ ET 3 and the recommended error value ET 1 ).
在式(7)中,EF(V2,U2i|)表示待測物標準圖F2的像素層級的特徵向量V2與第i張已選影像的像素層級的特徵向量U2i,其中已選影像是指已被用以執行運算取得誤差值的影像,例如在第3B圖(執行第1次疊代)中,已選影像即是初始待測物影像MT1(攝像模組140在基於第3A(a)圖之第1個初始光學參數組PT1之設定下取得)、初始待測物影像MT2(攝像模組140在基於第3A(a)圖之第2個初始光學參數組PT2之設定下取得)及初始待測物影像MT3(攝像模組140在基於第3A(a)圖之第3個初始光學參數組PT3之設定下取得);在第3D圖中(執行第2次疊代)來說,已選影像即是初始待測物影像MT1、MT2及MT3,以及第一個推薦待測物影像MR1(攝像模組140在基於第3C(a)圖之第一個推薦光 學參數組PR1之設定下取得)。在本實施例中,特徵向量V2及特徵向量U2i為像素層級的特徵向量,例如表示RGB或HSV(色相、飽和度、明度),然而在其他實施方式中,向量V2及向量U2i也可以是圖像層級的特徵向量,例如深度學習模型抽取出來的特徵向量。 In formula (7), EF(V2 , U2 i | ) represents the pixel-level feature vector V2 of the standard image F2 of the object under test and the pixel-level feature vector U2 i of the i-th selected image, where the selected image refers to the image that has been used to perform calculations to obtain error values, for example In Figure 3B (executing the first iteration), the selected image is the initial image MT 1 of the object to be measured (the camera module 140 is based on the first initial optical parameter set PT 1 in Figure 3A(a) setting), the initial image of the object to be measured MT 2 (the camera module 140 is obtained based on the setting of the second initial optical parameter set PT 2 in Figure 3A(a)), and the initial image of the object to be measured MT 3 (the Module 140 is obtained under the setting of the 3rd initial optical parameter set PT 3 based on Fig. 3A(a)); in Fig. 3D (executing the second iteration), the selected image is the initial The images MT 1 , MT 2 and MT 3 of the object to be measured, and the first recommended image MR 1 of the object to be measured (the camera module 140 is obtained based on the setting of the first recommended optical parameter set PR 1 in FIG. 3C(a) ). In this embodiment, the feature vector V2 and the feature vector U2 i are feature vectors at the pixel level, such as representing RGB or HSV (hue, saturation, lightness), but in other implementations, the vector V2 and the vector U2 i can also be is the feature vector at the image level, such as the feature vector extracted by the deep learning model.
如式(6)及(7)所示,當第j個候選光學參數組xRj相較於第i個已選光學參數組xTi的差距愈大時(即,Corr(xTi,xRj)的值愈小),期望值Φ(xj)愈大,表示第j個候選光學參數組xRj有愈大的機率能產生比fmin更小的誤差值。每一組候選光學參數組xRj可取得一個期望值Φ(xRj)。光學參數推薦模組130可使用J個不同數值的候選光學參數組xRj,取得對應之J個期望值Φ(xRj),並決定J個期望值Φ(xRj)中最大者所對應的第j個候選光學參數組xRj為推薦光學參數組PRn。 As shown in formulas (6) and (7), when the gap between the j-th candidate optical parameter set xR j and the i-th selected optical parameter set xT i is larger (that is, Corr(xT i , xR The smaller the value of j ), the larger the expected value Φ(x j ), which means that the jth candidate optical parameter set xR j has a higher probability of producing an error value smaller than f min . Each set of candidate optical parameter sets xR j can obtain an expected value Φ(xR j ). The optical parameter recommendation module 130 can use J different values of candidate optical parameter groups xR j to obtain corresponding J expected values Φ(xR j ), and determine the jth corresponding to the largest of the J expected values Φ(xR j ). The candidate optical parameter sets xR j are recommended optical parameter sets PR n .
參考第3B~3C(b)圖,基於式(6)~(7)取得第1個推薦光學參數組PR1的流程舉例說明如下。光學參數推薦模組130先取得數個候選光學參數組xRj之分別相較於所有已選光學參數組xTi的數個期望值Φ(xRj),然後決定(挑選)此些期望值Φ(xRj)中之最大者之候選光學參數組xRj為第1個推薦光學參數組。取得第1個候選光學參數組xR1之期望值Φ(xR1)的過程舉例說明如下。 Referring to Figures 3B-3C(b), the process of obtaining the first recommended optical parameter set PR 1 based on formulas (6)-(7) is illustrated as follows. The optical parameter recommendation module 130 first obtains several expected values Φ(xR j ) of several candidate optical parameter sets xR j compared to all selected optical parameter sets xT i , and then determines (selects) these expected values Φ(xR The largest candidate optical parameter set xR j in j ) is the first recommended optical parameter set. The process of obtaining the expected value Φ(xR 1 ) of the first candidate optical parameter set xR 1 is illustrated as follows.
如第3A(a)圖所示,在已選光學參數組xTi的數量為3個(Q=3),且初始光學參數組PTm包含PT1、PT2及PT3的情況下,執行式(6)之運算。此時,在i等於1且j等於1的情況下,光學參數推薦模組130在執行式(6)之運算,取得第1個已選光學參數組xT1 (如,初始光學參數組PT1)及第1個候選光學參數組xR1之Corr(xT1,xR1)的值(計算式:);並且運算取得待測物標準圖F2之像素層級之特徵向量V2與第1張已選影像(如,第1張初始待測物影像MT1)的像素層級的特徵向量U21的初始誤差值ET1(初始誤差值ET1為式(7)之EF(V2,U21|)的結果值)。 As shown in Figure 3A(a), when the number of selected optical parameter sets xT i is 3 (Q=3), and the initial optical parameter set PT m includes PT 1 , PT 2 and PT 3 , execute The operation of formula (6). At this time, when i is equal to 1 and j is equal to 1, the optical parameter recommendation module 130 performs the operation of formula (6) to obtain the first selected optical parameter set xT 1 (for example, the initial optical parameter set PT 1 ) and the value of Corr(xT 1 ,xR 1 ) of the first candidate optical parameter set xR 1 (calculation formula: ); and obtain the initial error between the pixel-level feature vector V2 of the standard image F2 of the UUT and the pixel-level feature vector U2 1 of the first selected image (for example, the first initial UUT image MT 1 ) value ET 1 (the initial error value ET 1 is EF(V2 , U2 1 | ) for the resulting value).
光學參數推薦模組130在i等於2且j等於1的情況下,執行式(6)之運算,取得第2個已選光學參數組xT2(如,初始光學參數組PT2)及第1個候選光學參數組xR1之Corr(xT2,xR1)的值(計算式:);並且運算取得待測物標準圖F2之特徵向量V2與第2張已選影像(如,第2張初始待測物影像MT2)的特徵向量U22的初始誤差值ET2(初始誤差值ET2為式(7)之EF(V2,U22|)的結果值)。 The optical parameter recommendation module 130 executes the operation of formula (6) when i is equal to 2 and j is equal to 1, and obtains the second selected optical parameter set xT 2 (for example, the initial optical parameter set PT 2 ) and the first The value ( calculation formula : ); and obtain the initial error value ET 2 ( initial error The value ET 2 is EF(V2 , U2 2 | ) for the resulting value).
光學參數推薦模組130在i等於3(Q之值)及j等於1的情況下,執行式(6)之運算,取得第3個已選光學參數組xT3(如,初始光學參數組PT3)及第1個候選光學參數組xR1之Corr(xT3,xR1)的值(計算式:);並且執行運算取得待測物標準圖F2之特徵向量V2與第3(即,i=3)張已選影像(如,第3張初始待測物影像MT3)的特徵向量U23的初始誤差值ET3(初始誤差值ET3為式(7)之EF(V2,U23|)的結果值)。
The optical parameter recommendation module 130 executes the operation of formula (6) when i is equal to 3 (the value of Q) and j is equal to 1, and obtains the third selected optical parameter set xT 3 (for example, the initial optical parameter set PT 3 ) and the value of Corr(xT 3 ,xR 1 ) of the first candidate optical parameter set xR 1 (calculation formula: ); and perform calculations to obtain the characteristic vector V2 of the standard image F2 of the UUT and the
然後,光學參數推薦模組130可依據式(7),取得之商值、之商值及之商值,並在取得此些商值之加總(和值計算式:)後,運算式(7)之期望值分析函數E,取得(或計算出)第1個候選光學參數組xR1之期望值Φ(xR1)。 Then, the optical parameter recommendation module 130 can obtain the business value of The commercial value of and quotient value, and obtain the sum of these quotient values (sum value calculation formula: ), calculate the expected value analysis function E of formula (7), and obtain (or calculate) the expected value Φ(xR 1 ) of the first candidate optical parameter set xR 1 .
依據前述原則,光學參數推薦模組130可取得在J個不同的候選光學參數組xRj的J個期望值Φ(xRj)。光學參數推薦模組130可從J個期望值Φ(xRj)中挑選出最大者,並決定該最大者為第1(即,n=1)個推薦光學參數組PR1,如第3B圖所示。 According to the aforementioned principle, the optical parameter recommendation module 130 can obtain J expected values Φ(xR j ) in J different candidate optical parameter sets xR j . The optical parameter recommendation module 130 can select the largest one from J expected values Φ(xR j ), and decide that the largest one is the first (ie, n=1) recommended optical parameter set PR 1 , as shown in FIG. 3B Show.
在取得第1個推薦光學參數組PR1後,執行步驟S124,自動設定模組150依據第1個推薦光學參數組PR1設定自動光學檢測系統100。自動設定模組150可依據推薦光學參數組PR1設定光源模組160及攝像模組140。例如,以推薦光學參數PR1[x(1),x(2)]之x(1)為曝光時間而x(2)為發光時間來說,自動設定模組150設定攝像模組140的曝光時間為推薦光學參數組PR1之x(1)的數值,且設定光源模組160的發光時間為推薦光學參數組PR1之x(2)的數值。自動設定模組150可自動依據推薦光學參數組設定光源模組160及/或攝像模組140,不需人工操作,如此可減少光學參數自動設定的所需時,間且增加光學參數自動設定的效率。在另一實施例中,若以人工設定,自動光學檢測系統100可選擇性省略自動設定模組150。
After obtaining the first recommended optical parameter set PR 1 , step S124 is executed, and the
執行步驟S130中,誤差運算模組120將n的初始值設為1。步驟S130與S124的兩者間的執行順序不限,可以任一先執行或同時執行。 In step S130 , the error calculation module 120 sets the initial value of n to 1. The order of execution between steps S130 and S124 is not limited, and may be executed first or at the same time.
在步驟S140中,攝像模組140在在該自動光學檢測系統100是用第1個推薦光學參數組PR1設定下對待測物執行取像,以取得第1個推薦待測物影像MR1。
In step S140 , the camera module 140 performs imaging of the object under test under the setting of the first recommended optical parameter set PR 1 in the automatic
在步驟S150中,誤差運算模組120依據式(5)之優化誤差函數EF,對待測物標準圖F2之像素層級之特徵向量V2與第1個推薦待測物影像MR1之像素層級之特徵向量U2執行運算,而取得待測物標準圖F2與第1個推薦待測物影像MR1之間的第1個推薦誤差值ER1,如第3C(a)圖所示。 In step S150, the error calculation module 120 calculates the pixel-level feature vector V2 of the standard image F2 of the test object and the pixel-level feature of the first recommended test object image MR1 according to the optimized error function EF of formula (5). The vector U2 performs calculations to obtain the first recommended error value ER 1 between the standard image F2 of the UUT and the first recommended UUT image MR 1 , as shown in FIG. 3C(a).
如第3C(a)圖所示,光學參數推薦模組130可採用曲線擬合方法,取得初始誤差值ET1、ET2、ET3與推薦誤差值ERn的擬合曲線C2。 As shown in FIG. 3C(a), the optical parameter recommendation module 130 can use a curve fitting method to obtain a fitting curve C2 between the initial error values ET 1 , ET 2 , ET 3 and the recommended error value ER n .
在步驟S160中,誤差運算模組120判斷推薦誤差值是否收斂。當誤差運算模組120判斷推薦誤差值收斂時,流程進入步驟S190;當判斷推薦誤差值未收斂時,流程進入步驟S170。 In step S160 , the error calculation module 120 determines whether the recommended error value converges. When the error calculation module 120 judges that the recommended error value is convergent, the process proceeds to step S190; when it judges that the recommended error value is not convergent, the process proceeds to step S170.
在一實施例之步驟S160中,當推薦誤差值等於或小於一收斂門檻值或在數次疊代後之數個推薦誤差值之任二者的差值於一收斂變動範圍之間變動,則誤差運算模組120判斷誤差值已收斂。前述「收斂門檻值」例如是介於0.1~0.3之間的任一數值(包含端點值),「數次疊代」例如是等於或大於3次,而「收斂變動 範圍」例如是介於0.1~0.3之間的任一數值(包含端點值),然本揭露實施例不以此為限。 In step S160 of an embodiment, when the recommended error value is equal to or smaller than a convergence threshold or the difference between any two of several recommended error values after several iterations varies within a convergence variation range, then The error calculation module 120 determines that the error value has converged. The aforementioned "convergence threshold value" is, for example, any value between 0.1~0.3 (including the endpoint value), the "number of iterations" is, for example, equal to or greater than 3 times, and the "convergence variation The "range" is, for example, any value between 0.1-0.3 (including the endpoint value), but the embodiments of the present disclosure are not limited thereto.
如第3C(b)圖所示,經由步驟S150運算取得的第1個推薦誤差值ER1,其並未小於前次疊代取得之最小誤差值(在此即為第0次疊代次取得之多個初始誤差值中最小者初始誤差值ET2),因此在第1次疊代後,最小誤差值仍為初始誤差值ET2。由於第1個推薦誤差值ER1並未小於前次疊代的最小誤差值(即為第0次疊代之初始誤差值ET2),誤差運算模組120據此判斷最小誤差值尚未收斂,流程進入步驟S170。 As shown in Figure 3C(b), the first recommended error value ER 1 obtained through step S150 is not smaller than the minimum error value obtained in the previous iteration (here, it is obtained in the 0th iteration Among the multiple initial error values, the minimum initial error value ET 2 ), therefore, after the first iteration, the minimum error value is still the initial error value ET 2 . Since the first recommended error value ER 1 is not smaller than the minimum error value of the previous iteration (that is, the initial error value ET 2 of the 0th iteration), the error calculation module 120 judges that the minimum error value has not yet converged, The flow goes to step S170.
在步驟S170中,光學參數推薦模組130依據n個推薦誤差值、n個推薦光學參數組、M個初始誤差值及M個測試初始光學參數組執行運算,而取得第n+1個推薦光學參數組。換言之,光學參數推薦模組130採用式(6)及(7),運算所有已選光學參數組xTi(包含n個推薦光學參數組及M個測試初始光學參數組)及所有已運算取得之誤差值(包含n個推薦誤差值及M個初始誤差值),取得下一個(即,n+1)推薦光學參數組PRn+1(第n+1個推薦光學參數組)。 In step S170, the optical parameter recommendation module 130 performs calculations based on n recommended error values, n recommended optical parameter sets, M initial error values, and M test initial optical parameter sets to obtain the n+1th recommended optical parameter set parameter group. In other words, the optical parameter recommendation module 130 uses equations (6) and (7) to calculate all selected optical parameter sets xT i (including n recommended optical parameter sets and M test initial optical parameter sets) and all calculated optical parameter sets Error values (including n recommended error values and M initial error values), and the next (ie, n+1) recommended optical parameter set PR n+1 (the n+1th recommended optical parameter set) is obtained.
以下進一步舉例說明透過式(6)~(7)取得第2個推薦光學參數組PR2的流程(對應第3D~3E(b)圖)。過程中,光學參數推薦模組130先運算取得數個候選光學參數組xRj之各者相較於所有已選光學參數組xTi的數個期望值Φ(xRj),然後決定此些期望值Φ(xRj)中之最大值者之候選光學參數組xRj為第2個推薦光學參數組 PR2。以下以第1個候選光學參數組xR1為例,來說明運算期望值Φ(xRj)的過程。 The following further illustrates the process of obtaining the second recommended optical parameter set PR 2 through formulas (6)~(7) (corresponding to Figures 3D~3E(b)). During the process, the optical parameter recommendation module 130 first calculates and obtains several expected values Φ(xR j ) of each of several candidate optical parameter sets xR j compared to all selected optical parameter sets xT i , and then determines these expected values Φ The candidate optical parameter set xR j with the maximum value in (xR j ) is the second recommended optical parameter set PR 2 . The following takes the first candidate optical parameter set xR 1 as an example to illustrate the process of calculating the expected value Φ(xR j ).
如第3C(a)圖所示,已選光學參數組xTi的數量係4個(Q=4),包含3個初始光學參數組PT1、PT2及PT3以及1個推薦光學參數組PT1。 As shown in Figure 3C(a), the number of selected optical parameter sets xT i is 4 (Q=4), including 3 initial optical parameter sets PT 1 , PT 2 and PT 3 and 1 recommended optical parameter set pt1 .
在i等於1且j等於1的情況下運算式(6),光學參數推薦模組130依據式(6)運算第1(即,i=1)個已選光學參數組xT1(如,初始光學參數組PT1)及第1(即,j=1)個候選光學參數組xR1之Corr(xT1,xR1)的值(計算式:),且運算待測物標準圖F2之像素層級之特徵向量V2與第1(即,i=1)張已選影像(如,第1張初始待測物影像MT1)的像素層級的特徵向量U21的初始誤差值ET1(初始誤差值ET1為式(7)之EF(V2,U21|)的運算結果值)。 When i is equal to 1 and j is equal to 1, formula (6) is calculated, and the optical parameter recommendation module 130 calculates the first (i.e., i=1) selected optical parameter set xT 1 according to formula (6) (for example, the initial Optical parameter set PT 1 ) and the value of Corr(xT 1 , xR 1 ) of the first (ie, j=1) candidate optical parameter set xR 1 (calculation formula: ), and calculate the pixel-level feature vector V2 of the standard image F2 of the DUT and the pixel-level features of the first (ie, i=1) selected image (for example, the first initial DUT image MT 1 ) The initial error value ET 1 of the vector U2 1 (the initial error value ET 1 is EF(V2 , U2 1 | ) operation result value).
在i等於2且j等於1的情況下運算式(6),光學參數推薦模組130依據式(6)運算第2(即,i=2)個已選光學參數組xT2(如,初始光學參數組PT2)及第1(即,j=1)個候選光學參數組xR1之Corr(xT2,xR1)的值(計算式:),且運算待測物標準圖F2之特徵向量V2與第2(即,i=2)張已選影像(如,第2張初始待測物影像MT2)的特徵向量U22的初始誤差值ET2(初始誤差值ET2為式(7)之EF(V2,U22|)的結果值)。
When i is equal to 2 and j is equal to 1, formula (6) is calculated, and the optical parameter recommendation module 130 calculates the second (i.e., i=2) selected optical parameter set xT 2 according to formula (6) (for example, the initial Optical parameter set PT 2 ) and the value of Corr(xT 2 , xR 1 ) of the first (ie, j=1) candidate optical parameter set xR 1 (calculation formula: ), and calculate the initial error between the eigenvector V2 of the standard image F2 of the UUT and the
在i等於3及j等於1的情況下運算式(6),光學參數推薦模組130依據式(6)運算第3(即,1=3)個已選光學參數組xT3(如,初始光學參數組PT3)及第1(即,j=1)個候選光學參數組xR1之Corr(xT3,xR1)的值(計算式:Corr(xT 3 ,xR 1)=),且運算待測物標準圖F2之特徵向量V2與第3(即,i=3)張已選影像(如,第3張初始待測物影像MT3)的特徵向量U23的初始誤差值ET3(初始誤差值ET3為式(7)之EF(V2,U23|)的結果值)。
When i is equal to 3 and j is equal to 1, formula (6) is calculated, and the optical parameter recommendation module 130 calculates the third (that is, 1=3) selected optical parameter set xT 3 according to formula (6) (for example, the initial Optical parameter group PT 3 ) and the value of Corr(
在i等於4及j等於1的情況下運算式(6),光學參數推薦模組130依據式(6)運算第4(即,i=4)個已選光學參數組xT4(如,推薦光學參數組PR1)及第1(即,j=1)個候選光學參數組xR1之Corr(xT4,xR1)的值(計算式:),且運算待測物標準圖F2之特徵向量V2與第4(即,i=4)張已選影像(如,推薦光學參數組PR1)的特徵向量U24的推薦誤差值ER1(推薦誤差值ER1為式(7)之EF(V2,U24|)的結果值)。 When i is equal to 4 and j is equal to 1, formula (6) is calculated, and the optical parameter recommendation module 130 calculates the 4th (i.e., i=4) selected optical parameter set xT 4 according to formula (6) (for example, recommended Optical parameter set PR 1 ) and the value of Corr(xT 4 , xR 1 ) of the first (ie, j=1) candidate optical parameter set xR 1 (calculation formula: ), and calculate the recommended error value ER 1 ( The recommended error value ER 1 is EF(V2 , U2 4 | ) for the resulting value).
然後,光學參數推薦模組130可利用前述運算結果執行運算,取得之商值、之商值、之商值及之商值,並運算此些商值之加總(計算式:)後,再進一步依據式(7)之期望值分析函數E執行運算,取得第1個候選光學參數組xR1之期望值Φ(xR2)。
Then, the optical parameter recommendation module 130 can use the aforementioned calculation results to perform calculations to obtain the business value of the business value of The commercial value of and quotient value, and calculate the sum of these quotient values (calculation formula: ), and further perform operations according to the expected value analysis function E of formula (7), and obtain the expected value Φ(xR 2 ) of the first candidate optical parameter set
依據前述流程,光學參數推薦模組130可取得在J個不同的候選光學參數組xRj的J個期望值Φ(xRj)。光學參數推薦模組130可從J個期望值Φ(xRj)中挑選出最大者,並決定期望值最大者之xRj為第2(即,n+1)個推薦光學參數組PR2,如第3D圖所示。 According to the aforementioned process, the optical parameter recommendation module 130 can obtain J expected values Φ(xR j ) in J different candidate optical parameter sets xR j . The optical parameter recommendation module 130 can select the largest one from J expected values Φ(xR j ), and determine xR j of the one with the largest expected value as the second (ie, n+1) recommended optical parameter set PR 2 , as shown in the first 3D figure shown.
在取得第2個推薦光學參數組PR2後,則執行步驟S175。 After the second recommended optical parameter set PR 2 is obtained, step S175 is executed.
在步驟S175中,自動設定模組150依據第2個(第n+1個)推薦光學參數組PR2設定自動光學檢測系統100。
In step S175 , the
在步驟S180中,累加n的值(n=2),然後執行下一輪疊代,也就是再次執行步驟S140,在第2(n=2)次疊代中,攝像模組140在該自動光學檢測系統被用第2個推薦光學參數組PR2設定的情況下,對待測物執行取像,以取得第2個推薦待測物影像MR2。然後,執行步驟S150,在第2次疊代中,光學參數推薦模組130依據式(5)之優化誤差函數EF,對待測物標準圖F2與第2個推薦待測物影像MR2執行運算,而取得待測物標準圖F2與第2個推薦待測物影像MR2之間的第2個推薦誤差值ER2,如第3E(a)圖所示。在第3E(a)圖中,光學參數推薦模組130可採用曲線擬合方法,取得初始誤差值ET1、ET2及ET3與推薦誤差值ER1及ER2的擬合曲線C3。執行步驟S160,光學參數推薦模組130判斷推薦誤差值是否收斂。當判斷推薦誤差值收斂時,則執行步驟S190;當判斷推薦誤差值未收斂時,則執行步驟S170。如第3E(b)圖所示,第2個推薦誤差值ER2並未小於推薦誤差值ER1以及前幾次疊代 (第0次疊代與第1次疊代)決定之最小誤差值(初始誤差值ET2),光學參數推薦模組130據此判斷推薦誤差值尚未收斂,則執行步驟S170。 In step S180, the value of n is accumulated (n=2), and then the next iteration is executed, that is, step S140 is executed again. In the second (n=2) iteration, the camera module 140 When the detection system is set with the second recommended optical parameter set PR 2 , image acquisition is performed on the object to be measured, so as to obtain the second recommended image MR 2 of the object to be measured. Then, step S150 is executed. In the second iteration, the optical parameter recommendation module 130 performs calculations on the standard image F2 of the object to be measured and the second recommended image MR2 of the object to be measured according to the optimized error function EF in formula (5). , and obtain the second recommended error value ER 2 between the standard image F2 of the test object and the second recommended image MR 2 of the test object, as shown in FIG. 3E(a). In FIG. 3E(a), the optical parameter recommendation module 130 can use a curve fitting method to obtain a fitting curve C3 between the initial error values ET 1 , ET 2 , and ET 3 and the recommended error values ER 1 and ER 2 . Step S160 is executed, and the optical parameter recommendation module 130 determines whether the recommended error value converges. When it is judged that the recommended error value is converged, step S190 is executed; when it is judged that the recommended error value is not converged, step S170 is executed. As shown in Figure 3E(b), the second recommended error value ER 2 is not less than the recommended error value ER 1 and the minimum error value determined by the previous iterations (0th iteration and 1st iteration) (initial error value ET 2 ), the optical parameter recommendation module 130 judges that the recommended error value has not yet converged, and then executes step S170.
在步驟S170中,光學參數推薦模組130採用前述決定推薦光學參數組之流程,運算取得第3個推薦光學參數組PR3,並執行步驟S175依據第3個推薦光學參數組PR3設定自動光學檢測系統100,及步驟S180以更新n(n=3)而進入下次疊代(第3次疊代)。在第3次疊代中,與前述第2次疊代相似地,執行步驟S140~S160,而運算取得第3個推薦誤差值ER3(如第3F及3G(a)圖所示)。接著執行S160,如第3G(b)圖所示,雖然第3個推薦誤差值ER3小於前幾次疊代結果之推薦誤差值ER1及ER2,及最小誤差值ET2,但第3個推薦誤差值ER3並未低於收斂門檻值,光學參數推薦模組130據此判斷推薦誤差值尚未收斂,而進入下一輪的疊代,執行步驟S170~S180,取得下一次疊代之第n個推薦光學參數組PRn。
In step S170, the optical parameter recommendation module 130 adopts the above-mentioned process of determining the recommended optical parameter set, calculates and obtains the third recommended optical parameter set PR 3 , and executes step S175 to set the automatic optics according to the third recommended optical parameter set PR 3 The
如第3H(a)圖所示,光學參數推薦模組130依據前述原則,依序取得第4(即,n=4)次疊代之第4個推薦誤差值ER4、第5(即,n=5)次疊代之第5個推薦誤差值ER5、第6(即,n=6)次疊代之第6個推薦誤差值ER6及第7(即,n=7)次疊代之第7個推薦誤差值ER7。如第3H(b)圖所示,在第7次疊代的步驟S160中,第7個推薦誤差值ER7已低於前述收斂門檻值,光學參數推薦模組130據此判斷推薦誤差值已收斂,則執行步驟S190,光學參數推薦模組130決定第7次疊代之最小推薦誤差值,也就是第7個推薦誤差值
ER7所對應之第7個推薦光學參數組ER7為自動光學檢測系統100之最佳光學參數組。
As shown in Figure 3H(a), the optical parameter recommendation module 130 sequentially obtains the fourth recommended error value ER 4 and the fifth (ie, The fifth recommended error value ER 5 of the n=5) iteration, the sixth recommended
自動光學檢測系統100之光源模組160及攝像模組140可依據此最佳光學參數組設定於產線上運作,使攝像模組140對產品攝像所取得的產品影像具有最佳的品質(例如色彩呈現),以提升自動光學檢測系統100檢測產品的準確度。
The
綜上,本揭露實施例提出一種光學參數自動設定方法及應用其之自動光學檢測系統,利用機器學習的技術,自動取得最佳光學參數組。在應用本揭露實施例之光學參數自動設定方法中,在短時間內須對P個或全部光學參數進行高達數萬、數十萬次或甚至更多次的疊代,且計算過程繁複,此必須由電腦執行,非人腦所能完成。由於是採用電腦執行光學參數自動設定方法,因此在執行過程可考慮自動光學檢測系統中可能影響攝像器所擷取之產品影像呈現(或品質)的所有光學參數的至少一者,提升攝像器所擷取之產品影像的品質,增加檢測正確率。相較於人工調光,本揭露實施例具備以下數個技術功效的至少一者:(1).避免人為因素的誤判,因此可提升調光穩定性;(2).減少調光所需時間;(3).降低人力成本;(4).加入調光流程的光學參數類型的數量可以較多;(5).增加自動光學檢測系統的檢測正確率。 To sum up, the embodiments of the present disclosure propose a method for automatically setting optical parameters and an automatic optical inspection system using the same, using machine learning technology to automatically obtain the optimal optical parameter set. In the application of the method for automatically setting optical parameters according to the disclosed embodiments, tens of thousands, hundreds of thousands or even more iterations must be performed on P or all optical parameters in a short period of time, and the calculation process is complicated. It must be executed by a computer, not by a human brain. Since the computer is used to execute the automatic setting method of optical parameters, at least one of all optical parameters in the automatic optical inspection system that may affect the presentation (or quality) of the product image captured by the camera can be considered during the execution process, so as to improve the performance of the camera. The quality of captured product images increases the detection accuracy. Compared with manual dimming, the disclosed embodiments have at least one of the following technical effects: (1). Avoid misjudgment due to human factors, thus improving the stability of dimming; (2). Reduce the time required for dimming ; (3). Reduce labor costs; (4). The number of optical parameter types added to the dimming process can be large; (5). Increase the detection accuracy of the automatic optical detection system.
綜上所述,雖然本揭露已以實施例揭露如上,然其並非用以限定本揭露。本揭露所屬技術領域中具有通常知識者,在不脫離 本揭露之精神和範圍內,當可作各種之更動與潤飾。因此,本揭露之保護範圍當視後附之申請專利範圍所界定者為準。 To sum up, although the present disclosure has been disclosed above with embodiments, it is not intended to limit the present disclosure. Those with ordinary knowledge in the technical field to which this disclosure belongs, without departing from Various changes and modifications may be made within the spirit and scope of this disclosure. Therefore, the scope of protection of this disclosure should be defined by the scope of the appended patent application.
S110~S190:步驟 S110~S190: steps
Claims (16)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110115481A TWI792291B (en) | 2021-04-29 | 2021-04-29 | Method of automatically setting optical parameters and automated optical inspection system using the same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110115481A TWI792291B (en) | 2021-04-29 | 2021-04-29 | Method of automatically setting optical parameters and automated optical inspection system using the same |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202242713A TW202242713A (en) | 2022-11-01 |
TWI792291B true TWI792291B (en) | 2023-02-11 |
Family
ID=85793303
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW110115481A TWI792291B (en) | 2021-04-29 | 2021-04-29 | Method of automatically setting optical parameters and automated optical inspection system using the same |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI792291B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020009220A1 (en) * | 1999-11-29 | 2002-01-24 | Olympus Optical Co., Ltd. | Defect inspection system |
CN107561737A (en) * | 2017-08-21 | 2018-01-09 | 武汉精测电子技术股份有限公司 | A kind of method, apparatus and instrument of AOI system IPC parameter adjust automaticallies |
TWI683262B (en) * | 2018-06-08 | 2020-01-21 | 財團法人工業技術研究院 | Industrial image inspection method and system and computer readable recording medium |
TW202013314A (en) * | 2018-09-18 | 2020-04-01 | 台灣積體電路製造股份有限公司 | Method for determining wafer inspection parameters |
CN111751279A (en) * | 2019-03-27 | 2020-10-09 | 鸿富锦精密工业(武汉)有限公司 | Optical image capturing parameter adjusting method and sensing device |
-
2021
- 2021-04-29 TW TW110115481A patent/TWI792291B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020009220A1 (en) * | 1999-11-29 | 2002-01-24 | Olympus Optical Co., Ltd. | Defect inspection system |
CN107561737A (en) * | 2017-08-21 | 2018-01-09 | 武汉精测电子技术股份有限公司 | A kind of method, apparatus and instrument of AOI system IPC parameter adjust automaticallies |
TWI683262B (en) * | 2018-06-08 | 2020-01-21 | 財團法人工業技術研究院 | Industrial image inspection method and system and computer readable recording medium |
TW202013314A (en) * | 2018-09-18 | 2020-04-01 | 台灣積體電路製造股份有限公司 | Method for determining wafer inspection parameters |
CN111751279A (en) * | 2019-03-27 | 2020-10-09 | 鸿富锦精密工业(武汉)有限公司 | Optical image capturing parameter adjusting method and sensing device |
Also Published As
Publication number | Publication date |
---|---|
TW202242713A (en) | 2022-11-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI751376B (en) | Identifying nuisances and defects of interest in defects detected on a wafer | |
CN107145908B (en) | A kind of small target detecting method based on R-FCN | |
JP6869490B2 (en) | Defect inspection equipment, defect inspection methods, and their programs | |
US8331650B2 (en) | Methods, systems and apparatus for defect detection | |
CN112567428B (en) | Photographing method and photographing device | |
US11631230B2 (en) | Method, device, system and computer-program product for setting lighting condition and storage medium | |
CN111242123A (en) | Power equipment fault diagnosis method based on infrared image | |
CN111815564B (en) | Method and device for detecting silk ingots and silk ingot sorting system | |
CN109886947A (en) | The high-tension bus-bar defect inspection method of convolutional neural networks based on region | |
JP2021515927A (en) | Lighting condition setting method, devices, systems and programs, and storage media | |
TW201825883A (en) | Optimizing training sets used for setting up inspection-related algorithms | |
CN108445010A (en) | Automatic optical detection method and device | |
CN115147363A (en) | Image defect detection and classification method and system based on deep learning algorithm | |
CN114881987A (en) | Improved YOLOv 5-based hot-pressing light guide plate defect visual detection method | |
CN112903692B (en) | Industrial hole wall defect detection system and identification algorithm based on AI | |
TWI792291B (en) | Method of automatically setting optical parameters and automated optical inspection system using the same | |
CN114913086B (en) | Face image quality enhancement method based on generation countermeasure network | |
CN116843618A (en) | Method for detecting shallow apparent appearance defects of metal parts | |
CN116106319A (en) | Automatic detection method and system for defects of synthetic leather | |
CN106951888B (en) | Relative coordinate constraint method and positioning method of human face characteristic point | |
CN115018787A (en) | Anomaly detection method and system based on gradient enhancement | |
US11788972B2 (en) | Method of automatically setting optical parameters and automated optical inspection system using the same | |
CN112949385B (en) | Water surface target detection and identification method based on optical vision | |
US20230325413A1 (en) | Error Factor Estimation Device and Error Factor Estimation Method | |
CN114486895A (en) | Method for detecting sample substance concentration based on pushing of urine drying test strip to identification |