how to extract horizontal and vertical garadients of image.
    10 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
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 ?
0 Commenti
Risposte (3)
  Anthony
      
 il 27 Gen 2014
        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
0 Commenti
  Image Analyst
      
      
 il 27 Gen 2014
        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;
0 Commenti
  pankaj chouthmal
 il 29 Gen 2014
        1 Commento
  Image Analyst
      
      
 il 29 Gen 2014
				The one that gets the job done for you. I don't really care as long as it works.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


