Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Computer Vision HW1

電機四 b09507018 羅文頡


1. Difference of Gaussian
(1) Plot 8 DoG images descripted in page.7 with threshold 3.0 on 1.png
1St Octave
1st DoG 2nd DoG

3rd DoG 4th DoG

2nd Octave
1st DoG 2nd DoG

3rd DoG 4th DoG


(2) Use three thresholds (1.0, 2.0, 3.0) on 2.png, plot DoG feature, and describe
the difference. (5%)
Threshold Feature Picture
1.0

2.0
3.0

Difference 隨著 Threshold 增加,我們可以找到的 Feature 點就會隨之減


少。原先 1.0 上會連貓咪腹部毛色都會被認成 Edge,但是到
3.0 基本上只剩零星的點在腹部毛上
2. Joint bilateral filter
(1) Report the cost for each filtered image (by using 6 grayscale images as
guidance) (1%+1%)
1.png 2.png
R,G,B Cost R,G,B Cost
cv2.COLOR_BGR2GRAY 1207799 cv2.COLOR_BGR2GRAY 183850
R*0.0+G*0.0+B*1.0 1439568 R*0.0+G*0.0+B*1.0 77882
R*0.0+G*1.0+B*0.0 1305961 R*0.0+G*1.0+B*0.0 86023
R*0.1+G*0.0+B*0.9 1393620 R*0.1+G*0.0+B*0.9 188019
R*0.1+G*0.4+B*0.5 1279697 R*0.1+G*0.4+B*0.5 128341
R*0.8+G*0.2+B*0.0 1127913 R*0.8+G*0.2+B*0.0 110862
(2) Show original RGB image, two filtered RGB images and two grayscale
images with highest and lowest cost (five images in total for each input
image) (2%+2%)
1.png
Original
Highest Lowest

Highest Lowest

2.png
Original

Highest Lowest
Highest Lowest

(3) Describe the difference between those two grayscale images. (5%+5%)
在 Cost 比較高的圖片裡面,Grayscale 完的 guidance 圖片大部分都比較
難以辨別顏色,許多原本在 RGB 上面差異很大的顏色在這邊差異都被
弱化。相反的 Cost 較低的圖片裡面,Grayscale 之後 guidance 圖片還是
可以很明顯看到各個圖片的邊界差別,不會輕易被混淆。
1.png 裡面,我們很明顯可以看到 High cost 的 grayscale guidance 圖片
的葉子跟周圍幾乎都是暗的,尤其葉子連接到背景草地的地方。相反
的 Low Cost 整個葉子的顏色非常明亮,和背景有非常大的差異。
2.png 裡面,High Cost 的幾何圖形之間,雖然在 RGB 上面有顯著顏色
差距,但是變為 Grayscale 之後,有些區域幾乎看不太到顏色上面的差
別。而 Low Cost 裡面還是維持著每一個顏色區域都有高度的反差。
(4) Describe how you speed up the implementation of bilateral filter. (5%)
我主要是用了兩個方法。第一是建立 LUT,G_r 跟 G_s 的值都需要非常
複雜的計算,且同時我們都可以列出相對應的所有值,因此很適合使
用 LUT 方式進行加速,當我們知道 index 跟 pixel,我們就直接用查表
的就好,不需要浪費時間。再來是盡可能利用 Numpy 所提供的功能進
行矩陣處理,讓我們的運算能夠得到優化。

You might also like