This thesis proposes a method to compose a foreground object into a background image, where the foreground object is a part (or a region) of an image taken by a front-facing camera and the background image is a whole image taken by a back-facing camera in a smart phone at the same time. Recent high-end cell-phones have two cameras with preview feature before taking photos. The method extracts the foreground object that is moving along with the front-facing camera using the optical flow during the preview. Then, the extracted foreground object is composed into a background image using a simple image composition technique.
For better-looking result in the composed image, a border smoothing technique is applied using a weighted-border mask to blend transparency from background to foreground. Since constructing and grouping pixel-level dense optical flow are quite slow even in high-end cell-phones, the computation of a mask to extract the foreground object in low-resolution image is needed to reduce the computational cost greatly.
Experimental result shows the effectiveness of our extraction and composition techniques, with much less computational time in extracting the foreground object and better composition quality compared with Poisson image editing technique which is widely used in image composition. The proposed method can improve the color bleeding artifacts observed in Poisson image editing using weighted-border masks.