2007年11月8日 星期四

Week8 Chapter5

◎讀後心得:
-----------------------------------------------------------
5.1

spatial filtering需要三個步驟:
1. Position the mask over the current pixel.
把mask放在current pixel上。
2. Form all products of filter elements with the corresponding elements of the neighborhood.
filter element與neighborhood上相對位置的值的乘積做運算。
3. Add all the products.
加上所有的值。

5.2
Ignore the edges因為所有輸出邊的像素會比原圖來的小,所以會造成影像失真。
而Pad with zeros因假定所有外部影像皆設為0,所以他會和原圖一樣大,但會造
成影像有多餘的東西。

5.3
這章實做了 filtering
我輸入了以下指令:

c=imread('1.jpg');

g1=fspecial('gaussian',[5,5]);

imshow(filter2(g1,c)/256)

卻出現下列錯誤訊息

??? Function 'conv2' is not defined for values of class 'double'
and attributes 'full 3d real'.

書上解釋說filter2是針對二維的濾波器

所以必須先對讀出的圖轉成灰階

後來轉成灰階就可以執行了....


----------------------------------------------------------------
這禮拜大致進度到這邊,因為在忙其他科目的小考所沒並沒有太多時間來實作
這章的東西,從5.4節開始就看到有些模糊,希望能有再多一點時間來深入閱讀,
進度緩慢....不常看原文書的下場,目前碰到的問題都可以解決,所以這禮拜沒
貼上問題。

沒有留言:

張貼留言