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.

 채택된 답변

Image Analyst
Image Analyst 2014년 3월 3일

0 개 추천

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

댓글 수: 2

GARRETT
GARRETT 2014년 3월 3일
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,[]);
For 256 bins, you could use
h = hist(Gmag(:),256);

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Anand
Anand 2014년 3월 3일

0 개 추천

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

질문:

2014년 3월 3일

댓글:

2014년 3월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by