本研究採用可變焦透鏡搭配CCD攝影機所開發的自動光學量測系統來進行電子零件三維形貌與彩色高景深影像建構的探討,應用的方法與建立的程式有自動尋焦(Auto Focus)、焦點合成(Focus stacking)、對焦演算法(Focus algorithm) 、特徵檢測、影像強化…等影像處理技術。 本文所提出之光學量測系統的核心技術為可變焦透鏡搭配對焦演算法達成自動尋焦以及影像處理技術中的焦點合成。將可變焦透鏡與影像處理技術應用於本量測系統,有別於傳統光學量測系統,可以節省時間、降低輸出功率及裝置體積非常小,實驗空間安排靈活的優點。整體量測系統以對焦演算法用於自動尋焦為核心部份,以對焦演算法來判定影像對焦時的光焦度(focal power),藉由嚴謹規劃實驗得到高度與光焦度關係式將所對應光焦度轉為高度值,建構出待測物三維彩色形貌。量測系統透過改變可變焦透鏡的光焦度來調整焦距並搭配CCD攝影機取得數百張不同焦距的相片,接著利用對焦演算法計算清晰度來並記錄當前清晰影像的光焦度,所取得的光焦度與對應的對焦影像即可用來進行影像疊合。目前影像處理的模式常常藉由灰階化處理降低影像計算量與處理時間,故本研究藉YUV彩色空間解析影像的顏色,將建構出的高景深影像及三維形貌之顏色回復,達成高景深影像與三維彩色形貌重建,並由實驗驗證本研究所發展的量測方法與影像處理程式的成效與改善。
This research is an applied optical measurement system that uses image processing techniques such as Auto Focus, Focus Stacking, Focus Algorithm, etc. to capture images with CCD cameras and variable focus lenses. With the focus algorithm to calculate the clear basis, the focus synthesis uses the captured image to construct the three-dimensional shape of the object to be tested. The core of the varifocal optical measurement system proposed in this paper is the zoom lens and the focus algorithm to achieve automatic homing and focus synthesis in image processing technology. The image processing technology is applied to the measurement system, which is different from the traditional zoom. The optical measuring system can save time, reduce the output power, and the device volume is very small, and the experimental space is flexible. The overall measurement system uses the focus algorithm for automatic homing as the core part, and uses the focus algorithm to determine whether the image is in focus. The relationship between height and power is obtained by experiment, and the power is converted according to the relationship. For the height, the three-dimensional color contour of the object to be tested is constructed. The measurement system adjusts the focal length by changing the power of the variable focus lens and uses the CCD camera to obtain hundreds of photos of different focal lengths, and then uses the focus algorithm to calculate the sharpness and record the power of the current sharp image. The power information can be used for image overlay. At present, the image processing mode often reduces the amount of image calculation by grayscale. Therefore, this study uses the color space to analyze the color of the image, and restores the constructed high depth image and the color of the three-dimensional contour to achieve three-dimensional color contour reconstruction. This study successfully constructed three-dimensional color contours and high depth of field images of the object to be tested, and shortened the measurement time through the variable focus lens. However, the speed of data post-processing and the quality of color backfilling need to be improved, so the method of improving focus synthesis is accelerated. Post-processing speed and quality are the most important, in order to become a practical and practical three-dimensional shape measurement system.