Finding gradient differences in code?

13 ビュー (過去 30 日間)
Mia
Mia 2020 年 4 月 15 日
コメント済み: Mia 2020 年 4 月 16 日
Hi,
I'm finding edges using the gradient function.
[Gx, Gy] = gradient(imgaussfilt(im, gradientsigma), 'x', 'y');
In this code, what does the 'x' and 'y' do? I've tried removing them to see if I get the same answer (I don't) but I don't understand the difference?
Many thanks!
  1 件のコメント
darova
darova 2020 年 4 月 15 日
2d and 3d inputs of gradient are steps in X and Y directions. I don't know why it's working with symbolic 'x' and 'y'

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 15 日
This uses an undocumented syntax of the gradient(). Modern documentation no longer mentions this syntax; however it is still supported, probably due to backward compatibility. Even the documentation of 2013a does not mention this: https://www.mathworks.com/help/releases/R2013a/matlab/ref/gradient.html and documentation older than that are not available online. Unless someone remembers this old syntax, it is unlikely that you can find much more information.
Use this modern variant to find the gradient of an image: https://www.mathworks.com/help/images/ref/imgradient.html
  1 件のコメント
Mia
Mia 2020 年 4 月 16 日
Ah okay, thank you!

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by