ng'),'gray');
  [Gx,Gy]=gradient2(I); M=sqrt(Gx.^2+Gy.^2); O=atan2(Gy,Gx);
  full=0; [M1,O1]=gradientMag(I,0,0,0,full);
  D=abs(M-M1); mean2(D), if(full), o=pi*2; else o=pi; end
  D=abs(O-O1); D(~M)=0; D(D&gt;o*.99)=o-D(D&gt;o*.99); mean2(abs(D))

 See also gradient, <a href="gradient2.html" class="code" title="function [Gx,Gy] = gradient2( I )">gradient2</a>, <a href="gradientHist.html" class="code" title="function H = gradientHist( M, O, varargin )">gradientHist</a>, <a href="convTri.html" class="co