sharpening picture using unsharp - please check my code

9 Ansichten (letzte 30 Tage)
Hasbullah Hady
Hasbullah Hady am 1 Dez. 2011
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 Kommentare
Chandra Kurniawan
Chandra Kurniawan am 1 Dez. 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 am 1 Dez. 2011
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Particle & Nuclear Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by