フィルターのクリア

how to compute gradients of image using gradient() in matlab2010

2 ビュー (過去 30 日間)
Pornima  Birajdar
Pornima Birajdar 2015 年 7 月 23 日
編集済み: Walter Roberson 2015 年 8 月 1 日
im=imread('31.png');
im=rgb2gray(im);
[gx,gy]=gradient(im);
gx1=fft(radon(log(abs(fft2(diff(gx))))));
gy1=fft(radon(log(abs(fft2(diff(gy))))));
gxy=gx+gy;
imshow(gxy);
getting error while computing gradient(im);
  1 件のコメント
Thorsten
Thorsten 2015 年 7 月 23 日
Please post the error message.

サインインしてコメントする。

回答 (1 件)

David Young
David Young 2015 年 7 月 23 日
As Thorsten says, you should always post the error message. But here's a guess at what might help:
im=imread('31.png');
im=rgb2gray(im);
im = im2double(im);
[gx,gy]=gradient(im);
This converts the image array to a class which gradient can handle. It also rescales the values to the range 0-1, which improves code portability and makes subsequent display simpler.

Community Treasure Hunt

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

Start Hunting!

Translated by