sharpening picture using unsharp - please check my code

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 个评论

Would you upload your image??
I just wonder how can 'tomato' image becomes 'predator' image after you perform edge_detection on that.
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Data Import and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by