[心得] 圖片的頻域濾波已回收

看板MATLAB作者 (源)時間16年前 (2009/06/28 21:11), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/1
寫了一個小程式,可以讀入灰階影像並且做頻域濾波,給大家分享。 clear all close all clc [FileName,PathName] = uigetfile('*.bmp','Select the input bitmap file'); if (PathName == 0) warndlg('The input bitmap is empty.','!! Warning !!') else % input image file. inputFrame = double(imread(strcat(PathName, FileName))); if (size(inputFrame,3) ~= 1) warndlg('Only for gray bitmap.','!! Warning !!') else max(max(inputFrame)); % 2D fourier transform. frqFrame = fft2(inputFrame); % if the frequency intensity is lager than 100000, equaled to 0. frqFrame(frqFrame>100000)=0; % inverse 2D fourier transform resultFrame = ifft2(frqFrame); max(max(resultFrame)); % Two images are shown. imshow(uint8(inputFrame), [0 26]); figure, imshow(uint8(resultFrame), [0 26]); end end -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.235

06/28 23:29, , 1F
不錯~ 待會兒再看看DCT也能不能這樣用
06/28 23:29, 1F

06/30 18:41, , 2F
感謝分享喔^^
06/30 18:41, 2F
文章代碼(AID): #1AHsm5Nu (MATLAB)
文章代碼(AID): #1AHsm5Nu (MATLAB)