error while using imfilter function in matlab

17 Ansichten (letzte 30 Tage)
M Manohar prabhu
M Manohar prabhu am 27 Mär. 2020
Beantwortet: DGM am 10 Jan. 2024
code:
function result=gaussian_pyramid(img,level)
img=im2double(img);
h = 1/16* [1, 4, 6, 4, 1];
filter = h'*h;
result{1} = imfilter(img, filter, 'replicate', 'conv');
temp_img = img;
for i = 2 : level
temp_img = temp_img(1 : 2 : end, 1 : 2 : end);
result{i} = imfilter(temp_img, filt, 'replicate', 'conv');
end
end
the error is attached below

Antworten (1)

DGM
DGM am 10 Jan. 2024
The name of the filter variable is "filter", not "filt".
result{i} = imfilter(temp_img, filt, 'replicate', 'conv');
filt() is a function which, when called without any input arguments, will create an empty transfer function.
filt
ans = Empty transfer function.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by