Project 2 - Computer Vision - Hybrid Images

This is a class project for CSCI 4527/6527 Computer Vision at George Washington University.

Here is the code.

1. Overview

In this project, we explore hybrid images, which is high-frequency of one overlaid on the low-frequency of another images. Hybrid images are static images that change in interpretation as a function of the viewing distance. The basic idea is that high frequency tends to dominate perception when it is available, but, at a distance, only the low frequency (smooth) part of the signal can be seen. By blending the high-frequency portion of one image with the low-frequency portion of another, you get a hybrid image that leads to different interpretations at different distances. We used the approach described in the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns.

2. How It Works

Before constructing the hybrid, we first align the images together. Then, we convolve the two images with custom-tuned Gaussian filters. Every pair of images may require different parameters. We calculate the Laplacian of the second image by subtracting the Gaussian-filtered image from the original. The hybrid image is constructed by averaging the first's Gaussian-filtered image with the second's Laplacian image.

The main parameter to tune is the cutoff frequency \sigma_{f}: In order to extract the low frequencies in an image, we convolve the input image with a Gaussian function, which effectively serves as a low-pass filter. Likewise, we extract the high frequencies from an image using a Laplace filter, which I obtained by taking the difference of the input image and the input convolved with a Gaussian.

2.1 Procedure

  1. Align the images. The framework code provided a utility method which would rotate, rescale, and align two images based on two points, typically points of focus to anchor the images.

  2. Apply low-pass filter. Convolve the first input image with a Gaussian filter with sigma chosen based on the desired cutoff frequency as explained above.

  3. Apply high-pass filter. Convolve the second input image with a Laplacian filter with sigma chosen based on the desired cutoff frequency.

  4. Add the results together. This takes the two images and combines them into a single image with the different frequencies.

DerekCat:
image1 = DerekPicture.jpg, image2 = nutmeg.jpg,

sigma1 = 12, sigma2 = 12

Original

Filtered

Hybrid

3. Favorite Result With Analysis

Here is my favorite result where I combined earth with a basketball. You should see basketball looking at close distance and earth when looking from a far distance. I found that sigma = 2 for earth picture and sigma = 12 for basketball picture works the best. Here is the result:



Earth and basketball original images, and their filtered versions, and the hybrid images along with their FFT:










4. Bells and Whistles

I tried few images with black and white, but I don't feel it produces a satisfactory hybrid image. The reason might be as both input images are blurred, having colors helps visualization. Then I try using color to enhance the effect:

Tutankhamun+Zeus: Combine a low-pass-filtered Tutankhamun with a high-pass-filtered Zeus.



最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末静檬,一起剝皮案震驚了整個(gè)濱河市以清,隨后出現(xiàn)的幾起案子笋颤,更是在濱河造成了極大的恐慌佑笋,老刑警劉巖淆九,帶你破解...
    沈念sama閱讀 218,122評(píng)論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件冬耿,死亡現(xiàn)場(chǎng)離奇詭異蚀腿,居然都是意外死亡宣羊,警方通過查閱死者的電腦和手機(jī)斟览,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,070評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門毁腿,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人苛茂,你說我怎么就攤上這事已烤。” “怎么了妓羊?”我有些...
    開封第一講書人閱讀 164,491評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵胯究,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我躁绸,道長(zhǎng)裕循,這世上最難降的妖魔是什么臣嚣? 我笑而不...
    開封第一講書人閱讀 58,636評(píng)論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮剥哑,結(jié)果婚禮上硅则,老公的妹妹穿的比我還像新娘。我一直安慰自己株婴,他們只是感情好抢埋,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,676評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著督暂,像睡著了一般揪垄。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上逻翁,一...
    開封第一講書人閱讀 51,541評(píng)論 1 305
  • 那天饥努,我揣著相機(jī)與錄音,去河邊找鬼八回。 笑死酷愧,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的缠诅。 我是一名探鬼主播溶浴,決...
    沈念sama閱讀 40,292評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼管引!你這毒婦竟也來了士败?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,211評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤褥伴,失蹤者是張志新(化名)和其女友劉穎谅将,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體重慢,經(jīng)...
    沈念sama閱讀 45,655評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡饥臂,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,846評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了似踱。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片隅熙。...
    茶點(diǎn)故事閱讀 39,965評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖核芽,靈堂內(nèi)的尸體忽然破棺而出囚戚,到底是詐尸還是另有隱情,我是刑警寧澤狞洋,帶...
    沈念sama閱讀 35,684評(píng)論 5 347
  • 正文 年R本政府宣布弯淘,位于F島的核電站绿店,受9級(jí)特大地震影響吉懊,放射性物質(zhì)發(fā)生泄漏庐橙。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,295評(píng)論 3 329
  • 文/蒙蒙 一借嗽、第九天 我趴在偏房一處隱蔽的房頂上張望态鳖。 院中可真熱鬧,春花似錦恶导、人聲如沸浆竭。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,894評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)邦泄。三九已至,卻和暖如春裂垦,著一層夾襖步出監(jiān)牢的瞬間顺囊,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,012評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工蕉拢, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留特碳,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,126評(píng)論 3 370
  • 正文 我出身青樓晕换,卻偏偏與公主長(zhǎng)得像午乓,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子闸准,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,914評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容

  • +克服拖拖拉拉的惡習(xí)益愈,鼓足氣,完全該做的事? +吸引善知識(shí)來到我身邊夷家,聽到更多提升自己的念頭腕唧,凡事都可感恩! -批...
    ColleenMa閱讀 93評(píng)論 0 0
  • 對(duì)于他瘾英,沒有特別的喜歡也沒有特別的討厭枣接,習(xí)慣于每天定時(shí)的通話,天南地北的聊缺谴,但又不喜見面但惶,因?yàn)槲視?huì)下意識(shí)與心里...
    C_汐閱讀 180評(píng)論 0 0
  • 在android studio中創(chuàng)建aidl,直接在module上單擊右鍵湿蛔,選擇新建AIDL巷疼,則會(huì)module的目...
    yangweigbh閱讀 2,166評(píng)論 0 51