changeset 394:398990fe94b6

Do orientations mod pi
author hauberg
date Fri, 12 Feb 2010 22:52:54 +0000
parents 394c85635f2b
children 50f2b3ba9edd
files inst/edge.m
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/inst/edge.m
+++ b/inst/edge.m
@@ -353,14 +353,17 @@
       else
         sigma = 2;
       endif
+
       ## Change scale
       J = imsmooth(double(im), "Gaussian", sigma);
+
       ## Canny enhancer
       p = [1 0 -1]/2;
       Jx = conv2(J, p,  "same");
       Jy = conv2(J, p', "same");
       Es = sqrt( Jx.^2 + Jy.^2 );
-      Eo = atan2(Jy,Jx);
+      Eo = pi - mod (atan2 (Jy, Jx) - pi, pi);
+
       ## Get thresholds
       if (nargin > 2 && isscalar(varargin{1}))
         thresh = [0.4*varargin{1}, varargin{1}];