MATLAB: Image Gradient Magnitude : Compute: Sobel Image Gradients (Gx and Gy) Gradient magnitude (Gmag) and Gradient direction(Gdir)
조회 수: 15 (최근 30일)
이전 댓글 표시
Please help he what to edit on code.....
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/310244/image.png)
댓글 수: 0
답변 (1개)
Chit La Pyae Myo Hein
2020년 9월 23일
img=imread('cameraman.tif');
[Gx,Gy]=imgradientxy(img,'sobel');
%Uncomment the code below to visualize Gx and Gy
figure
imshowpair(Gx,Gy,'montage')
title(' Directional Gradients, Gx and Gy ,using Prewitt method')
%Uncomment the code below to visualize Gmag and Gdir
imshowpair(Gx,Gy,'montage')
title( 'Gradient Magnitude (Left) and Gradient Direction (Right)')
[Gmag,Gdir] = imgradient(Gx,Gy);
imshowpair(Gmag,Gdir,'montage')
title('Gradient Magnitude (Left) and Gradient Direction (Right)')
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!