I'm new to Matlab. I'm really just getting started into the actual computer science classes in my major. So, please keep that in mind. The goal is to create and apply a gaussian filter to this specific image using no built-in functions. So far, I have this bit of code to create a kernel. We were playing around with different sigma values, and then produced a visualization of the kernel.
f = imread( 'input.png');
sig = 5;
hw = floor (2.5 * sig - .5);
w = zeros(hw*2+1, hw*2+1);
for r = 1:size(w,1)
for c = 1:size(w,2)
w(r,c) = exp(-1 * ((c - (hw+1))^2 + (r-hw)^2) / (2 * sig^2));
end
end
imagesc(w);
colormap jet;
My problem comes when actually applying it. I'm really not sure on what to do. He gave us the following code as a guide, but I'm still stuck.
for r = 1:R
for c = 1:C
for r1 =
for c1 =
temp = temp + f() + w();
end
end
end
end
If anyone could point me in the right direction, it would be greatly appreciated. Thank you.