高斯 matlab程序,高斯金字塔 matlab程序实现
生活随笔
收集整理的這篇文章主要介紹了
高斯 matlab程序,高斯金字塔 matlab程序实现
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
高斯金字塔函數
function pyr = gauss_pyramid(I,nlev)
pyr = cell(nlev,1);
pyr{1} = I;
G_LOWER = I;
f = [.05, .25, .4, .25, .05];
f = f'*f;
for l = 2:nlev
G_LOWER=G_LOWER(1:2:size(G_LOWER,1)-1,1:2:size(G_LOWER,2)-1); %downsample
pyr{l}=imfilter(G_LOWER,f,'replicate');
end
end
執行函數
clear
inputPath = '../images/';
filename =[inputPath 'pai.png'];
I = im2double(imread(filename));
if size(I,3)==3
I=rgb2gray(I);
end
%高斯金字塔
gauss_pyr=gauss_pyramid(I,5);
for i=1:length(gauss_pyr)
figure;imshow(gauss_pyr{i});
end
效果圖
總結
以上是生活随笔為你收集整理的高斯 matlab程序,高斯金字塔 matlab程序实现的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: include php 失效,为什么in
- 下一篇: matlab线性拟合二元函数,求助:怎么