So I am having a reall issue trying to remove certain pixel vlaue from this image. So I am using the camera man image and a nosie has been applied to the image as show in code below.
A=imread('cameraman.tif');
x=1:size(A,2); y=1:size(A,1); [X,Y]=meshgrid(x,y);
noise= 30.*cos(2.*pi.*X./15 + 2.*pi.*Y./20);
B=double(A) + noise;
So now if I apply fft2 and fftshift in the code above like so:
A=imread('cameraman.tif');
x=1:size(A,2); y=1:size(A,1); [X,Y]=meshgrid(x,y);
noise= 30.*cos(2.*pi.*X./15 + 2.*pi.*Y./20);
B=double(A) + noise;
D = fft2(B);
C=fftshift(D);
E=imagesc(log((abs(C))))
and the image I get is the one below. I have also added circles to the part that I want to remove.
And this is where I kinda of gte stuck, beacuse I cant seem to figure a away on how to set these pixels to zeros. My attempt so far is this
A=imread('cameraman.tif');
x=1:size(A,2); y=1:size(A,1); [X,Y]=meshgrid(x,y);
noise= 30.*cos(2.*pi.*X./15 + 2.*pi.*Y./20);
B=double(A) + noise;
D = fft2(B);
C=fftshift(D);
E=imagesc(log((abs(C))));
[106.5 105.5 10 20]
L=(106.5:116.5);
H=(105.5:120.5);
E(L.*H)=0
So in the above code what I have done is, is use imcrop to get the cordinates of the top red circl, from the coordiates I reviced I assumed that it was of the layout
[x,y,x+10, y+10 ]
and put the vlaues of 106.5+10 into my length and 105.5+20 into my width so I then through if I multiply these to together i.e the area of the croped boxed and set them to 0 it would then set remove the highest red circle so when I read E back into the image is dose not seem to work and I am stucked to what I need to do. Is there a possiblty that someone could advise me on where I am going wrong.