Basic Anti-aliasing Filter (Intro to Signals & Systems)
Ältere Kommentare anzeigen
I am trying to create a function
zaa = antialias(z);
which inputs a hi-res image z and outputs high-res anti-aliased image zaa. The system needs to compute each point of zaa[x,y]:
.The given "high-res" image z is:
z = round(exp(-1/w.^2*((y.'-30).^2+(x-40).^2)));
I am confused on how to implement the Zaa equation into my function. Here's what I have for my function thus far:
function zaa = antialias(z)
zaa = zeros(size(z,1), size(z,2));
for nn = 1:size(z,1) % grabs the number of rows
for mm = 1:size(z,2) % grabs number of columns
if nn > 1 && nn < size(z,1) && mm > 1 && mm < size(z,2)
%zaa(nn,mm) = 1/4 * (z(nn-1,mm)+z(nn+1,mm)+z(nn,mm-1)+z(nn,mm+1));
%zaa(nn,mm) = 1/4 * z(nn-1,nn+1,mm-1,mm+1);
%zaa(nn,mm) = 1/4 * z(nn,mm);
%xx = [nn-1 nn+1 nn nn];
%yy = [mm mm mm-1 mm+1];
%zaa(nn,mm) = 1/4 * z(xx,yy);
end
end
end
end
The commented out section includes my 4 attempts at coding in the difference equation. I'm sure you can tell I am a novice with arrays and MATLAB. I am hoping for some guidence on how to write the function appropriately. Any help would be appreciated.
Thanks!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!