I'm using the "edge(img,'sobel')" function but it returns a matrix that is logical. Is there a way to make it a uint8? I want to see it just the filtering.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 3 Mär. 2014

0 Stimmen

Don't use edge(). Use imgradient() instead. You will get the actual Sobel filtered image.

2 Kommentare

GARRETT
GARRETT am 3 Mär. 2014
Thanks that worked, how would I show the histogram for it?
I was able to see it by [Gmag, Gdir] = imgradient(img,'sobel'); imshow(Gxy,[]);
Anand
Anand am 4 Mär. 2014
For 256 bins, you could use
h = hist(Gmag(:),256);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Anand
Anand am 3 Mär. 2014

0 Stimmen

[Gx,Gy] = imgradientxy(im,'sobel');

Gefragt:

am 3 Mär. 2014

Kommentiert:

am 4 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by