I have an image, say for example
z=double(rgb2gray(imread('onion.png')));
z=z./max(z(:));
imagesc(z)
However, ~10 pixels from all sides I get a different baseline that I'd like to remove. The baseline is probably because of gain artifact of the pixels at the edges.
Artificially, I can create that effect as follows:
m=zeros(size(z));
m(1,:)=5; m(end,:)=5;
m(:,1)=5; m(:,end)=5;
m=conv2(m,fspecial('gaussian',15,3),'same');
Such that the image I actually get is this one:
imagesc(z+m); % I assume the effect is additive but I dont know that
I'd like to remove that baseline frame and retain the original info in the edges of that image. Any ideas?
Some of the images has very smooth features, so I've tried to get rid of the "frame", by cropping the sides and extrapolate, but it's not doing a good job.