【研究簡介】
中文摘要:
智慧型手機與平板裝置在最近迅速發展,許多手持裝置的應用軟體也大量出現。表示行動運算以融入日常生活中。大部分智慧型手機都有相機的功能,使得手持裝置上的影像處理相關應用逐漸受到重視,包括影像編輯、影像修補,影像特效等。發展手持裝置上的影像處理演算法的困難之處在於要考慮手持裝置上有限的資源與處理器速度。
本論文提出建構於行動裝置上的影像物件置換演算法與創新應用。以人物為置換目標,可以達到趣味角色扮演的功能,也可以針對任何物件來進行置換。透過行動裝置上的照相機與觸控螢幕,系統提供使用者第一次拍照並圈選欲置換的物件區域,接著將欲置換的區域挖空並顯示在螢幕上,讓使用者可以對準要換入的目標物件並二次拍照,應用程式會將目標物件與第一張影像的背景合成,可提供使用者互動式的趣味影像編修應用。此演算法使用輪廓提取技術,將使用者圈選的輪廓自動校正,符合真正物件的輪廓;利用影像修補,自動修補目標物件與背景之間的空隙;利用顏色轉換,讓目標物件的影像色調更相近於欲置換的物件。
本論文的實驗分別為輪廓提取、影像修補與顏色轉換。我們使用大量的範例來驗證提出的影像物件置換演算法的效果。另外,影像修補是實作在手持裝置上,所以在實驗方面有針對大範圍與小範圍的修補區域,實際在手持裝置上測試影像修補的執行時間。
Abstract :
The applications of mobile devices have been rapidly developed on smart phones and tablets in recent years. Along with the rapid growth of the Internet community over the past decade, Mobile Computing has become a part of our everyday lives. Most mobile devices have built-in cameras. Therefore, the image processing applications on mobile devices are receiving more attentions, such as photo editing, image inpainting, and special effects on images. The difficulties of developing image processing algorithms on mobile devices are due to the limited resources and processing speed on these embedded systems.
In this thesis, we propose an image object replacement algorithm on mobile devices. First, the user can take a photograph. On the touch screen, he/she can draw the contour around the object for replacement. The system will display the photograph on the camera view, where the region inside the contour will be transparent. Secondly, the user can take a photograph again by aligning the transparent region with the target object in the real world. After taking the second image, he/she can draw the contour around the target object. The application will replace the target object of the second image on the background of the first image to compose a synthesized image. The digital image processing technologies applied include contour extraction, image inpainting, and color transfer. Contour extraction is used to modify the drawn object contour by the user. Image inpainting is used to fix the gaps between the target object and the background. We use color transfer to transfer the color tone of the target object from the replacement object.
The experimental results on the contour extraction, image inpainting, and color transfer are presented. Enormous examples are examined to show the effects of the proposed image object replacement algorithm. Our image inpainting algorithm is implemented on mobile devices, and the execute time on the mobile devices is studied.
【系統流程】
【結論】
本論文提出一套架構於行動手持裝置上的物件置換演算法。藉由手持裝置的便利性與行動性,可以讓使用者在任何地方,都可以進行角色置換。使用者也可以針對任何的物件,來進行物件的置換。另外,使用者在本系統也可以自行建立樣板,來提供其他使用者使用。使用者可以套用樣板來達到顏色轉換的功能。
主要的影像處理技術,著重在如何校正使用者在手持裝置上圈選後的物件輪廓,以及如何填補影像合成時所產生的空隙、樣板與二次拍照影像的顏色轉換。在輪廓校正方面,我們先在使用者圈選的輪廓選出幾個點,再根據這些點在法向量的固定範圍內,找到較強的梯度值,當作初始化的輪廓點。接著使用論文提出的輪廓追蹤的方法,將初始化的輪廓點進行輪廓追蹤,取的新的輪廓。由於我們在初始化輪廓點時,只有選取梯度值最大的點來當作我們的輪廓點,並沒有加入其他的判斷因素。因此在背景比較複雜、有陰影,或是背景與前景顏色相近時,會有較大的機會去選取到錯誤的輪廓點。所以未來將會加入其他的判斷條件,來加強選取輪廓點的技術。當前景與背景差異性大,或是背景比較單純的時候,輪廓提取的表現相當不錯。在填補空隙,我們選擇了論文所提出的方法,並加以修改成適合我們的案例。由實驗結果可看出,對於小區域的修補,都有良好的表現。但是對於修補區域過大的案例,由於是有方向性的填補,所以可看出有種向心力的往內填補的結果。又因為在填補過程,越往內修補,得到的真正顏色資訊其實是越少的,所以大區域的修補效果還是有待改進。顏色轉換方面,由實驗結果得知,論文的顏色轉換方法,可以將兩張色調不同的影像,有效的做顏色轉換。雖然會受到位置性的影響,但大部分的結果都有良好的表現。
本論文提出的樣板相對於 PhotoFunia 樣板,差別在於我們的樣板可以自行建立,然後計算出樣板的顏色標記集合後,即可對任何一張輸入的影像,進行顏色轉換。而 PhotoFunia 的樣板著重在於效果的呈現,是由系統事先算出影像特效後而建立樣板。Funny Camera 也是類似的應用,系統提供固定的樣板讓使用者使用,當使用者選定樣板之後,可以讓使用者直接在手機上進行編修。而我們的系統是直接利用二次拍照來達到編修的目的,透過使用者與被拍照者的互動,來增添使用者的樂趣。
(a)
(b)
圖 1 實驗結果 (a) 影像修補實驗結果 (b) 顏色轉換實驗結果
【主要相關論文】