フィルターのクリア

how to extract horizontal and vertical garadients of image.

4 ビュー (過去 30 日間)
pankaj chouthmal
pankaj chouthmal 2014 年 1 月 27 日
コメント済み: Image Analyst 2014 年 1 月 29 日
What is mean by horizontal and vertical gradients ? Suppose if we have 41*41 matrix or image, then how we can compute its horizontal and vertical gradients ?

回答 (3 件)

Anthony
Anthony 2014 年 1 月 27 日
Hi,
You can use the diff function. Let img be your image :
img = spiral(10); % For example
gradX = diff(img,1,1);
gradY = diff(img,1,2);
doc diff
Hope it helps,
Anthony

Image Analyst
Image Analyst 2014 年 1 月 27 日
You can imgradientxy)() in the Image Processing Toolbox. From the help:
I = imread('coins.png');
[Gx, Gy] = imgradientxy(I,'prewitt');
figure
imshowpair(Gx, Gy, 'montage');
title('Directional Gradients: x-direction, Gx (left), y-direction, Gy (right), using Prewitt method')
axis off;

pankaj chouthmal
pankaj chouthmal 2014 年 1 月 29 日
i have used both above methods to calculate image gradients but both answers are totally different . which one is more appropriate ?
  1 件のコメント
Image Analyst
Image Analyst 2014 年 1 月 29 日
The one that gets the job done for you. I don't really care as long as it works.

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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by