sharpening picture using unsharp - please check my code

9 views (last 30 days)
I have a grayscale picture, uint8 jpeg. The picture is about a blurred tomato. I tried to do some unsharp, I tried to blur it, take it edges, and add to the original one. But it seems different. Im using matlab 7.9.0(r2009b)
_____________________________________________________
blur_filter = [1/9 1/9 1/9; 1/9 1/9 1/9; 1/9 1/9 1/9];
tomato = imread('tomato.jpg');
blur_filter = blur_filter / sum(sum(blur_filter));
blur_tomato = imfilter(tomato, blur_filter);
edge_filter = [-1,-1,-1;-1,8,-1;-1,-1,-1];
edge_tomato=imfilter(blur_tomato, edge_filter);
sharp_tomato = tomato + edge_tomato;
subplot(2,2,1), image(tomato), title('Original tomato');
subplot(2,2,2), image(blur_tomato), title('Blur tomato');
subplot(2,2,3), image(edge_tomato), title('The edge taken from the
blur');
subplot(2,2,4), image(sharp_tomato), title('Sharp tomato');
__________________________________________________________________
sorry i dont know how to attach the picture here.
The problem is, I get pictures like a vision of predator from the predator movie, if you get what i mean.
  2 Comments
Chandra Kurniawan
Chandra Kurniawan on 1 Dec 2011
Would you upload your image??
I just wonder how can 'tomato' image becomes 'predator' image after you perform edge_detection on that.
Walter Roberson
Walter Roberson on 1 Dec 2011
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

Sign in to comment.

Answers (0)

Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!