作者maokejackson (百年難得發表文章)
看板PCCU-CS
標題[作業] 影像處理作業5
時間Sat Jun 16 00:48:36 2007
題目:實作中通濾波(bandpass)
參考Google,課本沒有 XD
我看《機器視覺在BGA銲球檢測上之應用》裡提到
bandpass是從鄰近的像素排序後取出中間值作為新的像素值
可以濾除影像中較孤立的像素點
用frequency domain的說法就是把高頻和低頻過濾掉
加強我們想要的頻段
========================== 程式開始 =========================
filename = 'grayscale.bmp';
img = double(imread(filename));
fh = fspecial('log');
himg = filter2(fh, img, 'same'); % 高通
bimg = medfilt2(img); % 中通
fl = fspecial('average');
limg = filter2(fl, img, 'same'); % 低通
figure('Name','Original Image', 'NumberTitle','off'), imshow(img,[])
figure('Name','High-Pass', 'NumberTitle','off'), imshow(himg/100)
figure('Name','Band-Pass', 'NumberTitle','off'), imshow(bimg,[])
figure('Name','Low-Pass', 'NumberTitle','off'), imshow(limg/256)
========================== 程式結束 =========================
我用fourier transform的方式來做band-pass跟以上結果相差好遠
不知道是哪裡出了問題 囧rz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.133.89.82
1F:→ hairless:沒關係...我愛你...^3^ 06/16 21:06