1287615 九、發明說明: 【發明所屬之技術領域】 本發明係有關一種使用彩色光栅次像素定位與 單螢幕之子母畫面切換的三維輪廓量測方法與重建 糸統,其兼顧光柵具有相同的對比度較易分辨、顯示1287615 IX. Description of the Invention: [Technical Field] The present invention relates to a three-dimensional contour measurement method and a reconstruction system using color raster sub-pixel positioning and single-screen picture switching of a single screen, which has the same contrast ratio as the grating Easy to distinguish and display
器具有可切換之子母畫面以及具有調整模組可以調 整光柵等功效。 W 【先前技術】 I 隨著產業技術之提升與產品少量多樣化的趨 勢,要領先對手、擴大市場的關鍵便在於縮短產品製 程時間,這也成了產品研發時非常重要的課題之一, 而相關之逆向工程技術也就越來越受到重視。舉凡產 品檢驗、工業製造、產品外形設計、物體外形掃描以 及多媒體動畫製作等,皆需要有一個可以快遠且精破 的量測技術作為依靠。而實現逆向工程最重要的便是 量測能力。 1 傳統自動化檢測技術可分為兩類,一為接觸式量 測,另一為非接觸式量測。非接觸式量測以光為量測 工具最被廣泛應用。一般是投影灰階光栅至一待測工 件上進行測量;但常因背景光擾亂待測工件實體而使 待測工件不明顯’以致出現條紋誤判。若是待測工件 表面太光滑亦會導致其中一部位強烈反光而使得其 他條紋漫滅不清或斷線。若待測工件有突然陡升陡降 之曲線易造成陰影而遭誤判為條紋,而產生條紋相交 6 1287615 之情形。 此外,傳統自動化檢測技術仍有以下缺點: [1] 單色光柵不易分辨。參閱第七圖,傳統採用 投射單色條紋掃描待測工件,若待測工件表面清楚, 結合高速、高解析度攝影裝置擷取光柵影像之相位移 式掃描疊紋方法,可完整重建待測工件之三維模型, 但如第十一及第十二圖所示,當光柵投射在不平坦之 待測工件表面時,光栅條紋會產生扭曲變形,若有一 > 部份被物體的陰影所覆蓋時,便很難判斷出那一條條 紋應該對應到那一條條紋,如此會影響到影像的重 建。 [2] 顯示器無可切換之子母畫面。傳統光學量測 法,其投影裝置之光柵與攝影裝置擷取之光柵影像, 是由兩個顯示器顯示,無法合併在單一晝面上顯示, 器材數量多,控制複雜且檢視不易。另外,反覆觀看 _ 影像與調整攝影裝置之焦距必需分開動作,無法在觀 看影像的同時,從顯示器直接調整攝影裝置,相當不 便。 [3] 光柵無法調整。習用光柵多半為固定設計, 其密度與對比度無法調整,若量測微元件易失去準確 性。 因此,有必要研發新技術,以解決上述缺弊。 【發明内容】 本發明之主要目的,在於提供一種使用彩色光柵 7 1287615 次像素定位與單螢幕之子母晝面切換的三維輪廓量 測方法與重建系統’其設計之光柵具有相同對比度較 易分辨。 本發明之次要目的’在於提供一種使用彩色光柵 次像素定位與單螢幕之子母晝面切換的三維輪廓量 測方法與重建系統,其顯示器具有可切換之子母畫 面0 m 本發明之又一目的,在於提供一種使用彩色光柵 -人像素疋位與單螢幕之子母畫面切換的三維輪廓量 /貝J方法與重建系統,其具有調整模組可以調整光柵。 本發明係提供一種使用彩色光栅次像素定位與 單螢幕之子母晝面切換的三維輪廓量測方法與重建 系統’其量測方法部分包括·· 一 ·預備步驟; 一 ·投影步驟;The device has a switchable picture and a function of adjusting the grating with an adjustment module. W [Prior Art] I With the improvement of industrial technology and the diversification of products, the key to leading the market and expanding the market is to shorten the manufacturing process time, which has become one of the most important topics in product development. Related reverse engineering techniques are gaining more and more attention. For product inspection, industrial manufacturing, product design, object shape scanning, and multimedia animation production, you need a measurement technology that can be fast and sophisticated. The most important thing to achieve reverse engineering is the measurement capability. 1 Traditional automated inspection techniques can be divided into two categories, one for contact measurement and the other for non-contact measurement. Non-contact measurement with light as the measurement tool is most widely used. Generally, the gray scale grating is projected onto a workpiece to be measured for measurement; however, the workpiece to be tested is often inconspicuous due to the background light disturbing the workpiece to be tested, so that the stripe misjudgment occurs. If the surface of the workpiece to be tested is too smooth, one of the parts will be strongly reflective and the other stripes will be unclear or broken. If the workpiece to be tested has a sudden steep rise and fall, the curve is easily caused by a shadow and is mistakenly judged as a stripe, and the stripe intersects 6 1287615. In addition, the traditional automated detection technology still has the following disadvantages: [1] Monochrome gratings are not easy to distinguish. Referring to the seventh figure, the workpiece is to be tested by using the projected monochrome stripe. If the surface of the workpiece to be tested is clear, combined with the high-speed, high-resolution photographic device to capture the phase-shifting scanning overlay method of the grating image, the workpiece to be tested can be completely reconstructed. The three-dimensional model, but as shown in the eleventh and twelfth figures, when the grating is projected on the surface of the workpiece to be tested that is not flat, the grating stripe will be distorted, if one > part is covered by the shadow of the object It is difficult to judge which stripe should correspond to that stripe, which will affect the reconstruction of the image. [2] The display has no switchable picture. The conventional optical measurement method, the raster image of the projection device and the raster image captured by the photographing device are displayed by two displays, and cannot be combined and displayed on a single surface. The number of devices is large, the control is complicated, and the inspection is not easy. In addition, it is quite inconvenient to repeatedly watch the _ image and adjust the focal length of the photographic device separately. It is not possible to adjust the photographic device directly from the display while viewing the image. [3] The raster cannot be adjusted. Conventional gratings are mostly fixed designs, and their density and contrast cannot be adjusted. If the measurement micro-components are easy to lose accuracy. Therefore, it is necessary to develop new technologies to solve the above shortcomings. SUMMARY OF THE INVENTION The main object of the present invention is to provide a three-dimensional contour measuring method using a color grating 7 1287615 sub-pixel positioning and a single-screen switching of a single screen, and a reconstruction system whose grating has the same contrast and is easy to distinguish. A secondary object of the present invention is to provide a three-dimensional contour measuring method and reconstruction system using color raster sub-pixel positioning and single-screen switching of a single screen, the display having a switchable picture of the mother and child 0 m. The invention provides a three-dimensional contour quantity/shell method and reconstruction system using color raster-human pixel clamping and single-screen picture switching, and an adjustment module can adjust the grating. The present invention provides a three-dimensional contour measurement method and reconstruction system using color raster sub-pixel positioning and single-screen sub-plane switching. The measurement method portion thereof includes a preliminary step; a projection step;
二·摘取影像步驟; 四·影像微調步驟; 五·影像處理步驟;以及 六·重建步驟。 其重建系統部分係包括: 才又〜裝置,係用以朝一待測工件發出一光栅光 線;該光栅光線具有複數栅線,其對比度均相同,該 光栅光線在該㈣I件上形成-光栅影像,其包括複 數色彩不同之條紋; 、 8 1287615 二 一攝影裝置,係用以從該待測工件上擷取該光栅 影像; 一中央處理單元,其至少包括: 一中央處理器,係對該光栅影像進行影像分析、 消除雜訊以及條紋細線化作業,並利用拋物線曲線分 佈分析,求得更精確之最低/最高灰階分佈的落點, 得到每一條紋細線化後之光柵影像中每一像素點,再 利用細線化條紋做拋物線曲線分佈擬合,求出條紋最 ’❿ 大之彎曲的程度,配合相位移技術以及相位重建得到 該待測工件之三維輪廓; 一顯示器,係與該中央處理器電性連接,該顯示 器至少具有兩種切換模式: [1] 同時顯示一第一顯示部及一第二顯示部:可 顯示該投影裝置欲投影之光柵/該攝影裝置擷取之光 柵影像;該第一顯示部至少可用於直接調整該攝影裝 I· 置之焦距、光圈及景深; [2] 以第二顯示部全螢幕顯示該光栅影像/三維 輪廓。 本發明之上述目的與優點,不難從下述所選用實 細例之詳細說明與附圖中,獲得深入瞭解。 錄以下列實施例並配合圖式詳細說明本發明 後: ' 【實施方式】 參閱第一及第二圖,本發明係一種『使用彩色光 9 1287615 才冊次像素定位與單螢幕之子母晝面切換的三維輪廓 篁測方法與重建系統』,其量測方法部分包括下列步 驟: —·預備步驟11 :準備一投影裝置20、一攝影 裝置30及一中央處理單元4〇 ; 二·投影步驟12 :啟動該投影裝置20,該投影 裝置20朝一待測工件9〇照射一光柵光線21,其具有 複數對比度相同之柵線,該光柵光線21在該待測工 件90上形成一光柵影像91,該光柵影像91由複數對 比度相同的條紋901(參閱第三及第四圖)組成; 三·擷取影像步驟13 :啟動該攝影裝置30,從 該待測工件90上擷取該光柵影像91 ; 四·影像微調步驟14 :該中央處理單元40設一 顯示器41,該顯示器41可同時顯示一第一顯示部 411(即子晝面)及一第二顯示部412(即母晝面),第二 顯示部412(即母晝面)顯示該投影裝置欲投影之光 栅,第一顯示部411 (即子晝面)顯示所擷取之光栅影 像,從該第一顯示部411(即子晝面)顯示所擷取之光 柵矽像’至少可用於調整該攝影裝置之焦距、光圈及 π深···· 4,直到第一顯示部41丨上呈現清晰之 光栅影像91時,可將該第一顯示部4丨丨從該顯示器 41上關閉,切換成第二顯示部4丨2在顯示器41全螢 幕顯不光拇影像91。 五·影像處理步驟15 :該中央處理單元4〇從該 ^ 1287615 • 攝影裝置30接收該光柵影像91 ;並對該光柵影像91 ' 進行影像分析、消除不必要之背景雜訊,再對光柵影 ' 像91進行條紋細線化作業; 六·重建步驟16 :利用條紋細線化後之光柵影像 91中每一像素點,配合相位移技術以及相位重建得到 該待測工件90之三維輪廓。 如此為本發明之使用彩色光柵次像素定位與單 螢幕之子母畫面切換的三維輪廓量測方法與重建系 ^ 統。 本發明之實際操作方法,係以該中央處理單元40 之中央處理器42預先製作欲進行投影之光柵(即光柵 光線21),該光柵中每一柵線(如第五圖之每一條紋) 之對比度均相同,光柵密度最好是5條/1mm,光柵 以彩色(彩色參考圖如附件一之第C圖所示)為最佳, 其色彩組合至少可為 R,G,B,1/2R,1/2G,1/2B,1/3R,1/3G, 1/3B,1/4R,1/4G,1/4B,(1/2R+1/2G),(1/2R+1/2B),(1/2G + 1/2B),(1/3R+1/3G),(1/3R+1/3B),(1/3G+1/3B)· · · · 等變化,R、G、B為色彩三原色,而彩色光栅條紋的 產生方式可為: I = [LPMxl.6 , LPMx3] ^minx3<255 5 then R^Random\〇 5 x3] ? i?e[〇 ? 255] else R = Random[〇 ? 255] ? i?e[〇 5 255] G = 3xl-R-Random[〇 ? 255] , G e [〇 , 255] B = 3xl-R-G 5 Be[〇 3 255] 1287615 其中I為每條光栅的整體加總亮度值,LPM(line pair/mm)為光柵數目,R、G、B為色彩三原色。將I 值限制在[ZiWxl·6,ΐΡΜχ3]間,可避免G、B值過飽 合,影響到光柵亮度的不均。R值由亂數產生,若光 柵之整體總亮度值(I值)太低,則限制R值的範圍在 [0,Ληίη Χ 3]間’如此可避免R、G、Β三值達到過飽合, 確保R、G、Β均可落在[0,255]間。G值也是由亂數 產生,範圍限制在[〇,255]間。 _ »· 彩色光柵條紋的產生方式亦可遵循投影出的彩 色光栅每條條紋的最高顏色亮度相同之法則,必須使 每條光柵的最高顏色亮度都相等,而最高顏色亮度如 的定義為:2. Extraction of image steps; 4. Image fine-tuning steps; 5. Image processing steps; and 6. Reconstruction steps. The reconstruction system includes: a device for emitting a grating light toward a workpiece to be tested; the grating light has a plurality of grid lines, the contrast is the same, and the grating light forms a raster image on the (four) I piece. The image includes a plurality of stripes of different colors; 8 1287615 21 is used to capture the raster image from the workpiece to be tested; a central processing unit includes at least: a central processing unit for the raster image Perform image analysis, noise removal, and stripe thinning, and use parabola curve distribution analysis to find the more accurate minimum/highest grayscale distribution drop points, and obtain each pixel point in the thinned raster image of each stripe. Then, the thin-lined stripe is used to make a parabolic curve distribution fitting, and the degree of bending of the stripe is obtained, and the three-dimensional contour of the workpiece to be tested is obtained by phase shifting technology and phase reconstruction; a display is connected to the central processing unit Electrically connected, the display has at least two switching modes: [1] simultaneously displaying a first display portion and a second display Portion: display the raster image to be projected by the projection device/the raster image captured by the photographing device; the first display portion can be used at least to directly adjust the focal length, aperture and depth of field of the photographing device; [2] The display portion displays the raster image/three-dimensional contour on the full screen. The above objects and advantages of the present invention will be readily understood from the following detailed description and drawings. The following embodiments are described in detail with reference to the drawings: 'Embodiment </ RTI> Referring to the first and second figures, the present invention is a type of sub-pixel positioning and single-screen sub-pixels using color light 9 1287615. The switching method of the three-dimensional contour surveying and reconstruction system includes the following steps: - preparatory step 11: preparing a projection device 20, a photographing device 30 and a central processing unit 4; 2. projection step 12 The projection device 20 is configured to emit a grating light 21 to a workpiece 9 to be tested, which has a plurality of grid lines having the same contrast, and the grating light 21 forms a raster image 91 on the workpiece 90 to be tested. The raster image 91 is composed of a plurality of stripes 901 having the same contrast (see the third and fourth figures); 3. capturing the image step 13: starting the photographing device 30, and extracting the raster image 91 from the workpiece 90 to be tested; Image fine-tuning step 14: The central processing unit 40 is provided with a display 41, which can simultaneously display a first display portion 411 (ie, a sub-surface) and a second display portion 412 (ie, a female surface) The second display portion 412 (ie, the mother side) displays the raster to be projected by the projection device, and the first display portion 411 (ie, the sub-surface) displays the captured raster image from the first display portion 411 (ie, the sub-frame) Displaying the captured raster image 'at least for adjusting the focal length, aperture, and π depth of the camera, until the first display portion 41 has a clear raster image 91, The first display unit 4 is turned off from the display 41, and switched to the second display unit 4丨2 to display the thumb image 91 on the full screen of the display 41. V. Image processing step 15: The central processing unit 4 receives the raster image 91 from the camera 12; and performs image analysis on the raster image 91', eliminates unnecessary background noise, and then raster image 'The stripe thinning operation is performed like 91; 6. Reconstruction step 16: The three-dimensional contour of the workpiece 90 to be tested is obtained by using the phase shift technique and the phase reconstruction for each pixel point in the raster image 91 after the thinning of the stripe. Thus, the three-dimensional contour measurement method and reconstruction system using the color raster sub-pixel positioning and the single screen switching of the single screen of the present invention. In the actual operation method of the present invention, the central processing unit 42 of the central processing unit 40 pre-produces the grating to be projected (ie, the grating light 21), and each gate line in the grating (such as each stripe in the fifth figure) The contrast ratio is the same, the grating density is preferably 5 strips/1 mm, and the grating is preferably colored (the color reference image is shown in Figure C of Annex I), and the color combination is at least R, G, B, 1 2R, 1/2G, 1/2B, 1/3R, 1/3G, 1/3B, 1/4R, 1/4G, 1/4B, (1/2R+1/2G), (1/2R+1) /2B), (1/2G + 1/2B), (1/3R+1/3G), (1/3R+1/3B), (1/3G+1/3B)· · · · R, G, and B are the three primary colors of color, and the color grating stripes can be generated as follows: I = [LPMxl.6 , LPMx3] ^minx3<255 5 then R^Random\〇5 x3] ? i?e[〇? 255 ] else R = Random[〇? 255] ? i?e[〇5 255] G = 3xl-R-Random[〇? 255] , G e [〇, 255] B = 3xl-RG 5 Be[〇3 255 ] 1287615 where I is the total summed brightness value of each grating, LPM (line pair/mm) is the number of gratings, and R, G, and B are the three primary colors. Limiting the value of I to [ZiWxl·6, ΐΡΜχ3] avoids the saturation of G and B values and affects the uneven brightness of the grating. The R value is generated by random numbers. If the overall total luminance value (I value) of the grating is too low, the range of the R value is limited to [0, Ληίη Χ 3]. This prevents the R, G, and Β values from reaching fullness. To ensure that R, G, and Β can fall between [0, 255]. The G value is also generated by random numbers, and the range is limited to [〇, 255]. _ »· The color grating stripe can also be generated in the same way as the highest color brightness of each stripe of the projected color raster. The highest color brightness of each stripe must be equal, and the highest color brightness is defined as:
Bn^Max(R,G,B) , Bn e[〇,255] 其中及、G、5為色彩三原色。欲使每條光栅的 最高顏色亮度均相等,則必須使每條光柵的心值相 等。而彩色光栅條紋的產生方式係隨機選擇一及值, 並限制值的最大值為如:. ^ = Random^),255^ if R > Bn , R = Bn 隨機選擇一 G值,並限制g值的最大值為仙: G = Random]^,255\ tf G> Bn , G = Bn 取及、G的最大值,若此值為如,則5的值可以 12 .1287615 - 是隨機選擇的值;若及、G的最大值不是5„,則令5 值為Bn if(Max(R,G) = Bn),B = Random[0,Bn] else B = Bn 參閱第二圖,將中央處理器42預先製好的光柵 輸出至該投影裝置20(例如為數位光源處理器,其英 文為 Digital Light Processing,簡稱 DLP),透過該 投影裝置20投射至該待測工件90上而形成光栅影 ’馨 像91。由該攝影裝置30擷取該光柵影像901並傳回 該中央處理單元40,並顯示於該中央處理單元4〇 之顯示器41上。 以該顯示器41之第一顯示部411顯示所擷取之 光栅影像91,並可用於調整該攝影裝置3〇,至該光 拇影像91清晰的呈現於該第一顯示部411上,再將 第一顯示部411從該顯示器41上關閉,切換成第二 |φ 顯示部412在顯示器41全螢幕顯示該光栅影像91。 以該中央處理器42將光桃影像91上之不同序號 的條紋901予以不同·之RGB色彩組合,正確地讀取 彩色之光柵影像91的條紋901位置,並重建出正確 之待測工件90的三維輪廓。 參閱第六圖,舉例來講,當光栅光線在待測工件 上形成光柵影像,假設有一參考平面,則待測工件表 面相對於參考平面的高度可表示為: 13 1287615 取少)=P〇'tme〇^CD_ (1)Bn^Max(R, G, B) , Bn e[〇, 255] where, and G, 5 are the three primary colors of color. To make the highest color brightness of each raster equal, you must equalize the heart value of each raster. The color grating stripe is randomly selected by a value, and the maximum value of the limit value is as follows: ^ ^ Random^), 255^ if R > Bn , R = Bn randomly select a G value, and limit g The maximum value of the value is: G = Random]^,255\ tf G> Bn , G = Bn is taken as the maximum value of G. If the value is such as, the value of 5 can be 12.1287615 - is randomly selected. Value; if and the maximum value of G is not 5, let 5 be Bn if(Max(R,G) = Bn), B = Random[0,Bn] else B = Bn See the second figure, the center The pre-made raster output of the processor 42 is output to the projection device 20 (for example, a digital light source processor, which is Digital Light Processing (DLP) in English), and is projected onto the workpiece 90 to be formed by the projection device 20 to form a grating shadow. 'Sweet image 91. The raster image 901 is captured by the photographing device 30 and transmitted back to the central processing unit 40, and displayed on the display 41 of the central processing unit 4. The first display portion 411 of the display 41 is displayed. The captured raster image 91 can be used to adjust the photographic device 3 〇 until the optical thumb image 91 is clearly presented in the first On the display unit 411, the first display unit 411 is turned off from the display 41, and switched to the second |φ display unit 412 to display the raster image 91 on the full screen of the display 41. The central processing unit 42 displays the light peach image 91. The stripe 901 of different serial numbers is combined with different RGB colors to correctly read the stripe 901 position of the color raster image 91, and reconstruct the correct three-dimensional contour of the workpiece 90 to be tested. Referring to the sixth figure, for example, When the grating light forms a raster image on the workpiece to be tested, assuming a reference plane, the height of the surface of the workpiece to be tested relative to the reference plane can be expressed as: 13 1287615 Less) = P〇'tme〇^CD_ (1)
2π(ί + ίαηθ0/ίαηθη) v J 其中P〇為光柵光線投射至參考平面之間距,θ〇 為投射角度,0η為攝影裝置擷取之D點與參考平面 之夾角,0 CD為D點相對於C點之相位值,假設0 η =9(Γ,則表面高度可表示為: K^y)= P〇 ^~°^CD (2)2π(ί + ίαηθ0/ίαηθη) v J where P〇 is the distance between the grating ray and the reference plane, θ〇 is the projection angle, 0η is the angle between the D point captured by the photographic device and the reference plane, 0 CD is the point D For the phase value at point C, assuming 0 η = 9 (Γ, the surface height can be expressed as: K^y) = P〇^~°^CD (2)
由於P〇與0 〇皆為定值,且參考平面可假設於任 何位置,因此待測工件表面輪廓可由投射至待測工件 上變形的條紋之相位分佈值來決定。 正弦強度分佈之數位光柵,其光強度與相位移之 間的關係可表示成: I{x,y) = I\x,y) + Γ {x,y)cos^{x,y) + δ] ( 3 ) 由於上式中有 I’(x,y)(average intensity)、Γ’(χ, y)(intensity modulation)以及 5 (phase modulation)三 個未知數,所以至少需要三組不同的方程式才可解 出,可以攝影裝置擷取四張光栅影像,以90度作為 相移角度,可得到相位值與光強度之間關係如下: 咖,少)=tan—1 ((/4-/2)/((-/3)) (4) 利用上式便可以得到每一個像素點的相位值;再 配合相位移技術以及相位重建得到該待測工件之三 維輪廓。 另外,本發明可應用線段投影法量測該待測工件 -1287615 : 90之表面高度;其係利用光柵條紋在待w件 • 面上產生之位移量的多寡’來計算待測工件90之‘ 度(如第八圖所示),主要方式如下,· 回 〔知待測X件9G細線化後之預定條紋的兩個端 點J6r/K,則其斜率奶為··Since both P 〇 and 0 〇 are constant values, and the reference plane can be assumed to be at any position, the surface profile of the workpiece to be tested can be determined by the phase distribution value of the stripe projected onto the workpiece to be tested. The relationship between the light intensity and the phase shift of a digital grating with a sinusoidal intensity distribution can be expressed as: I{x,y) = I\x,y) + Γ {x,y)cos^{x,y) + δ ] ( 3 ) Since there are three unknowns of I'(x,y)(average intensity), Γ'(χ, y) (intensity modulation) and 5 (phase modulation) in the above formula, at least three different equations are needed. Only can be solved, the camera can capture four raster images, with 90 degrees as the phase shift angle, the relationship between phase value and light intensity can be obtained as follows: coffee, less) = tan-1 ((/4-/2) ) / ((-/3)) (4) The phase value of each pixel can be obtained by using the above formula; and the three-dimensional contour of the workpiece to be tested is obtained by phase shifting technique and phase reconstruction. In addition, the line segment can be applied to the present invention. The projection method measures the surface height of the workpiece to be tested -1287615: 90; it calculates the degree of the workpiece 90 to be measured by using the amount of displacement of the grating stripe on the surface to be tested (as shown in the eighth figure) Show), the main way is as follows, · Back [I know the two endpoints J6r/K of the predetermined stripe after the 9G thinning of the X piece, the slope milk is...
Wj ~^L 尤2 一 鳴 欲計算線段上每-點之物體高度^,龍由線段 上之任意點攸”對直、線Μ做垂直線,線段作即為 所求之物體高度,而直線户0的斜率為·· · %= 一丄 my 利用直線J厶及直線户(?的聯立方程式,可求出兩 直線方程式的交點广)為·· [y^mxx^cxWj ~^L You 2 Yi Ming wants to calculate the height of each object on the line segment ^, the dragon is any point on the line segment 攸" Straight line, straight line, the line segment is the height of the object, and the line The slope of the household 0 is ·· · %= 一丄my Use the straight line J厶 and the straight line household (the joint equation of ?, you can find the intersection of the two linear equations) as ··· [y^mxx^cx
\y-m2x+c2 mx -m2 <\y-m2x+c2 mx -m2 <
Cy — Ci y3=mx ~~^ + Cl l mi,2 計算户、0兩點間的距離即可求得物體高度^為: d=pQ=^3-x)2 +(y3-yf 於數位影像處理分析上,如能將待測工件之像素 灰階、顏色,以及鄰近各像素之資訊一併納入考量, 則可將檢測精度提升至次像素的範圍。 15 1287615 因此於該重建步驟16中,可再利用拋物線曲線分 佈分析的方法將檢測精度提升至次像素的範圍。 如第九圖所示為原始數位影像中預定一條紋之橫 切面尤Γ的灰階分佈示意圖,圖中左邊所顯示的是原 始數位影像的條紋,圖中右邊所顯示的是原始數位影 像的一條紋之橫切面;如第十圖所示為拋物線曲 線分佈分析示意圖,假設拋物線方程式ρα(^)2+6,且 々>>為原始數位影像中某線段灰階分佈的最低或 最高之處;又此拋物線方程式有·三個未知數,需要三 組方程式來求解,因此取仏,及其前後兩點 於力故拋物線曲線分佈分析,以求得更精 確的最低或最高灰階分佈的落點。其相關數學式如下 所示: 假設原始數位影像中某線段灰階分佈的函數為拋 物線方程式: g = a{x- c)2 + b 取6:/,a)及其前後兩點广私❿;、办)做拋物線 曲線分佈分析: ' a(x〇-c)2+& = g〇 ^(x^cf +b = gx a(x2-cf +b = g2 求得此拋物線方程式的三個未知數3、△、 · ΆΧ〇 V^2 - )+ (g〇 ~ g2 )+ X2 (gj - g〇 )] 1287615 d ----__ (X〇 - C)2 一 (七一匀2 l) zz σ — — Go 客 1 Χ%ΐ - (χ。-c)2 一 (七―c)2 其中拋物線的頂點位於處,即在Xe=c處為 利用次像素的方法所逼近的影像中某線段灰階分佈的 最低或最高位置。 因本發明之投影裝置20朝待測工件90照射的光 栅光線21(如第五圖)係為彩色(如附件一第c圖所 示),故待測工件90形成之光柵影像91(如第三圖)亦 為彩色(如附件一第A圖所示),其每一條紋9〇1之對 比度均相同,即使光柵影像91在待測工件9〇表面上 有部分被其陰影覆蓋(如第四圖,其對應之彩色圖為 附件一之第B圖),仍可清楚分辨每一條紋的相接處, 確實重建待測物90之三維輪廓。 本發明之三維量測方法至少可廣泛應用於: [1] 光學類:測量產品形狀、曲率。 [2] 光通訊類:測量光纖端面。 [3] 半導體類:測量晶圓表面輪廓。 [4] 電子類:測量錫膏厚度。 [5] 機械類:測量機械實體之外觀形狀以及表面 粗糙度。 參閱第二圖,有關本發明之重建系統部分,其包 括: 17 .1287615 ' 一投影裝置20,係用以朝一待測工件9〇發出一 光栅光線21 ;該光柵光線21具有複數柵線,其對比 度均相同,該光柵光線21在該待測工件9〇上形成一 光栅影像91,其包括複數對比度均相同之條紋901 ; 一攝影裝置30,係用以從該待測工件90上擷取 該光栅影像91 ; 一中央處理單元40,係至少包括一顯示器41及 _ 一中央處理器42;其中: 該顯示器41,係可同時顯示一第一顯示部411 及一第二顯示部412;以該第一顯示部411(即子畫面) 顯示所擷取之光柵影像,可用於調整該攝影裝置3〇 之焦距、光圈及景深·· ··等,至該攝影裝置3〇 擷取之光柵影像91(也可以說是條紋901)相當清晰的 顯示於該第一顯示部411(即子畫面)時;將該第一顯 示部411關閉,該第二顯示部412在該顯示器上 _ 以全螢幕顯示該光柵影像91(也可以說是條紋901); 該中央處理器42,係可對該光柵影像91進行影 像分析、消除不必要之背景雜訊,再對該光栅影像91 進行條紋細線化作業,利用條紋細線化後之光柵影像 91中每一像素點,配合相位移技術以及相位重建得到 該待測工件90之三維輪廓,並顯示於該顯示器41。 如此為本發明之使用彩色光栅次像素定位與單 螢幕之子母晝面切換的三維輪廓重建系統。 參閱第二圖,實務上,該投影裝置20係為數位 18 1287615 • 光源處理器(Digital Light Processing,簡稱 DLP),其 具有高亮度、色調重現性正確、反應時間快、無雜訊 " 等優點,且其發出之光柵光線21係由該中央處理器 42預先處理成彩色(如第五圖所示,其彩色圖如附件 一之第C圖),相對該待測工件90上形成之光柵影像 91亦為彩色;該投影裝置20之鏡頭上又可包括一聚 焦透鏡22,其配合不同尺寸大小的待測工件90,控 制該投影裝置20輸出不同尺寸大小之光柵光線21。 該攝影裝置30係為感光耦合(Charge Coupled Device ,簡稱CCD)攝影機,最好是彩色攝影機。 本發明之使用彩色光柵次像素定位與單螢幕之 子母晝面切換的三維輪廓重建系統又包括: 一彩色光柵序號建立模組421,係用以將不同序 號之光栅影像91的條紋901予以不同的RGB色彩組 合0 一彩色光柵序號讀取模組422,係用以正確讀取 各彩色條紋901之位置,並重建出待測工件90正確 的三維輪廓,該彩色光柵序號建立模組421與該彩色 光柵序號讀取模組422皆可直接設於該中央處理器 42上。 一調整模組50,係用以產生並調整欲投影光柵 (也可以說是光柵光線21)之柵線的密度及明暗對比 度,該調整模組50可直接設於該中央處理器42上, 或是直接由該中央處理器42取代。 1287615 本發明之優點及功效歸納如下: Π]光柵具有相同對比度較易分辨。本發明投影 之光柵光線具有相同對比度(例如為彩色),當投射在 待測工件上時,即使待測工件表面有凹凸不平,使光 柵影像產生彎曲,甚至是受到待測工件陰影影響時, 仍可藉由彩色攝影裝置將彩色光柵的每一栅線位置 正確地讀取出來,並重建出精密之三維影像。 [2] 顯示器具有可切換之子母畫面。本發明之顯 示器具有可切換之子母畫面,其至少具備兩種功能: (a) 可顯示投影裝置欲投影之光栅,亦可顯示攝 影裝置擷取之光栅影像。 (b) 可由第一顯示部(即子畫面)直接輕易的調整 攝影裝置之焦距、光圈及景深·· ··等,使該攝影 裝置可以擷取清晰的光柵影像,在調整完攝影裝置 後’可以將其關閉,以全螢幕的第二顯示部(即母晝 面)清楚呈現三維輪廓之重建過程。 [3] 具有調整模組可以調整光栅光線。本發明設 有一調整模組’其用以產生並調整欲投影光柵(也可 以說是光柵光線)之栅線的密度及明暗對比度,以適 用於各種不同的待肩工件。 以上僅是藉由較佳實施例詳細說明本發明,對於 該實施例所做的任何簡單修改與變化,皆不脫離本發 明之精神與範圍。 由以上詳細說明,可使熟知本項技藝者明瞭本發 1287615 . 明的確可達成前述目的,實已符合專利法之規定,爰 提出發明專利申請。 【附件一】 第A圖係第三圖之彩色示意圖 第B圖係第四圖之彩色示意圖 第C圖係第五圖之彩色示意圖 【圖式簡單說明】 • 第一圖係本發明之三維輪廓量測方法之流程示意圖 第二圖係本發明之三維輪廓重建系統之基本架構示意圖 第三圖係本發明之光柵光線投射在待測工件上之示意圖一 第四圖係本發明之光柵光線投射在待測工件上之示意圖二 第五圖係本發明之光柵之示意圖 第六圖係本發明之光柵影像之條紋示意圖 第七圖係本發明之實際流程參考示意圖 第八圖係本發明之線段投影法之示意圖 第九圖係本發明之原始影像中之預定條紋之橫切面 的灰階分佈示意圖 第十圖係本發明之拋物線曲線分佈分析之示意圖 第十一圖係習用之光栅光線投射在待測工件上之示意圖一 第十二圖係習用之光柵光線投射在待測工件上之示意圖二 21 1287615 . 【圖式元件符號說明】 11預備步驟 12投影步驟 - 13撖取影像步驟 14影像微調步驟 15影像處理步驟 16重建步驟 20投影裝置 21光柵光線 22聚焦透鏡 30攝影裝置 40中央處理單元 41顯示器 411第一顯示部 412第二顯示部 42中央處理器 421彩色光柵序號建立模組 422彩色光柵序號讀取模組· 50調聱模組 90待測工件 91光柵影像 901條紋 22Cy — Ci y3=mx ~~^ + Cl l mi,2 Calculate the distance between the two points of the household and 0 to obtain the height of the object ^: d=pQ=^3-x)2 +(y3-yf in the digit In the image processing analysis, if the pixel gray level, color, and information of adjacent pixels of the workpiece to be tested are taken into consideration, the detection accuracy can be improved to the range of the sub-pixel. 15 1287615 Therefore, in the reconstruction step 16 The parabola curve distribution analysis method can be used to improve the detection precision to the sub-pixel range. As shown in the ninth figure, the gray-scale distribution diagram of the cross-section of a predetermined stripe in the original digital image is shown, which is shown on the left side of the figure. The stripe of the original digital image, the right side of the figure shows the cross section of a stripe of the original digital image; as shown in the tenth figure is a schematic diagram of the parabolic curve distribution analysis, assuming the parabolic equation ρα(^)2+6, and 々>> is the lowest or highest gray-scale distribution of a line segment in the original digital image; and this parabolic equation has three unknown numbers, which requires three sets of equations to solve, so the 仏, and the two points before and after Parabolic curve The cloth is analyzed to find a more accurate minimum or maximum gray-scale distribution. The relevant mathematical formula is as follows: Assume that the function of the gray-scale distribution of a line segment in the original digital image is a parabolic equation: g = a{x- c ) 2 + b take 6: /, a) and two points before and after; privately, do parabolic curve distribution analysis: ' a(x〇-c)2+& = g〇^(x^cf + b = gx a(x2-cf +b = g2 find the three unknowns of this parabolic equation 3, △, · ΆΧ〇V^2 - )+ (g〇~ g2 )+ X2 (gj - g〇)] 1287615 d ----__ (X〇- C)2 one (seven one uniform 2 l) zz σ — — Go guest 1 Χ%ΐ - (χ.-c)2 one (seven-c)2 where the vertices of the parabola Located at the point where Xe=c is the lowest or highest position of the gray scale distribution of a line segment in the image approached by the method using the sub-pixel. The grating light 21 irradiated by the projection device 20 of the present invention toward the workpiece 90 to be tested (eg The fifth picture) is colored (as shown in the attached figure c), so the raster image 91 (such as the third picture) formed by the workpiece 90 to be tested is also colored (as shown in Figure A of Annex A), each of which The contrast of a stripe 9〇1 is the same even if The gate image 91 is partially covered by the shadow on the surface of the workpiece 9 to be tested (as shown in the fourth figure, the corresponding color map is the first B of the attached figure), and the intersection of each stripe can still be clearly distinguished. The three-dimensional contour of the object to be tested 90 is reconstructed. The three-dimensional measuring method of the present invention can be widely applied at least: [1] Optical class: measuring product shape and curvature. [2] Optical communication class: measuring fiber end face. [3] Semiconductors: Measuring wafer surface profile. [4] Electronics: Measure the thickness of solder paste. [5] Mechanical: Measuring the appearance and surface roughness of mechanical entities. Referring to the second figure, a portion of the reconstruction system of the present invention includes: 17.1287615 'a projection device 20 for emitting a grating ray 21 toward a workpiece 9 to be tested; the grating ray 21 has a plurality of grid lines, The grating light 21 forms a raster image 91 on the workpiece 9 to be tested, and includes a plurality of stripes 901 having the same contrast; a photographing device 30 is configured to extract the workpiece 90 from the workpiece Raster image 91; a central processing unit 40, comprising at least one display 41 and a central processing unit 42; wherein: the display 41 is capable of simultaneously displaying a first display portion 411 and a second display portion 412; The first display unit 411 (ie, the sub-screen) displays the captured raster image, and can be used to adjust the focal length, the aperture, the depth of field, and the like of the imaging device 3 to the raster image 91 captured by the imaging device 3. (may also be said that the stripe 901) is displayed relatively clearly on the first display portion 411 (ie, the sub-screen); the first display portion 411 is turned off, and the second display portion 412 is displayed on the display in full screen The raster image 91 ( It can be said that the stripe 901); the central processing unit 42 can perform image analysis on the raster image 91, eliminate unnecessary background noise, and perform stripe thinning operation on the raster image 91, and thinning the stripe Each pixel in the raster image 91 is matched with a phase shifting technique and phase reconstruction to obtain a three-dimensional contour of the workpiece 90 to be tested, and is displayed on the display 41. Thus, the present invention is a three-dimensional contour reconstruction system using color raster sub-pixel positioning and single-screen switching of a single screen. Referring to the second figure, in practice, the projection device 20 is a digital 18 1287615 • Digital Light Processing (DLP), which has high brightness, correct color tone reproducibility, fast response time, and no noise. And the advantages, and the grating light 21 emitted by the central processing unit 42 is pre-processed into color (as shown in the fifth figure, the color map is shown in FIG. 1 of the attached figure), and is formed on the workpiece 90 to be tested. The raster image 91 is also colored. The lens of the projection device 20 can further include a focusing lens 22 for matching the workpieces 90 of different sizes to control the projection device 20 to output the grating light 21 of different sizes. The photographing device 30 is a Charge Coupled Device (CCD) camera, preferably a color camera. The three-dimensional contour reconstruction system using the color raster sub-pixel positioning and the single-screen switching of the single screen of the present invention further includes: a color raster number establishing module 421 for different stripes 901 of the raster image 91 of different serial numbers. RGB color combination 0 A color raster number reading module 422 is used to correctly read the position of each color stripe 901 and reconstruct the correct three-dimensional contour of the workpiece 90 to be tested, and the color raster number establishing module 421 and the color The raster number reading module 422 can be directly disposed on the central processing unit 42. An adjustment module 50 is configured to generate and adjust the density and brightness contrast of the raster lines of the grating to be projected (also referred to as the grating light 21). The adjustment module 50 can be directly disposed on the central processing unit 42, or It is replaced directly by the central processor 42. 1287615 The advantages and effects of the present invention are summarized as follows: Π] The grating has the same contrast and is easy to distinguish. The grating light of the projection of the invention has the same contrast (for example, color), and when projected on the workpiece to be tested, even if the surface of the workpiece to be tested has irregularities, the raster image is curved, even when affected by the shadow of the workpiece to be tested, Each gate line position of the color grating can be correctly read by a color photographing device, and a precise three-dimensional image can be reconstructed. [2] The display has a switchable picture. The display of the present invention has a switchable picture of a child, which has at least two functions: (a) can display a raster to be projected by the projection device, and can also display a raster image captured by the camera. (b) The focal length, aperture and depth of field of the photographic device can be directly and easily adjusted by the first display unit (ie, the sub-picture) so that the photographic device can capture a clear raster image after adjusting the photographic device. It can be turned off to clearly present the reconstruction process of the three-dimensional contour with the second display portion of the full screen (ie, the mother face). [3] With adjustment module to adjust the grating light. The present invention is provided with an adjustment module ' which is used to generate and adjust the density and contrast of the grid lines of the grating to be projected (also referred to as grating light) for use with a variety of different workpieces to be shouldered. The present invention has been described in detail with reference to the preferred embodiments of the present invention. From the above detailed description, those skilled in the art can understand that the above-mentioned object can be achieved by the present invention, and the invention has been made in accordance with the provisions of the Patent Law. [Attachment 1] Figure A is a color diagram of the third diagram. Figure B is a color diagram of the fourth diagram. Figure C is a color diagram of the fifth diagram. [Simple diagram of the diagram] • The first diagram is the three-dimensional contour of the present invention. 2 is a schematic diagram of the basic structure of the 3D contour reconstruction system of the present invention. The third diagram is a schematic diagram of the grating light of the present invention projected onto the workpiece to be tested. FIG. 4 is a diagram of the grating light of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 5 is a schematic view of a grating of the present invention. FIG. 6 is a schematic diagram of a stripe image of the present invention. FIG. 7 is a schematic diagram of an actual flow of the present invention. FIG. The ninth diagram is a schematic diagram of the gray scale distribution of the cross section of the predetermined stripe in the original image of the present invention. The tenth figure is a schematic diagram of the parabolic curve distribution analysis of the present invention. The eleventh figure is the conventional grating ray projection to be tested. Figure 12 on the workpiece is a schematic diagram of the conventional grating light projected onto the workpiece to be tested. 21 1287615 . 11 preliminary step 12 projection step - 13 capture image step 14 image fine adjustment step 15 image processing step 16 reconstruction step 20 projection device 21 grating light 22 focusing lens 30 photography device 40 central processing unit 41 display 411 first display portion 412 second Display unit 42 central processor 421 color raster number creation module 422 color raster number reading module · 50 tuning module 90 workpiece to be tested 91 raster image 901 stripe 22