[GRASS-SVN] r52512 - grass-addons/grass7/raster/r.houghtransform

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 3 01:45:21 PDT 2012


Author: annakrat
Date: 2012-08-03 01:45:21 -0700 (Fri, 03 Aug 2012)
New Revision: 52512

Modified:
   grass-addons/grass7/raster/r.houghtransform/houghtransform.cpp
Log:
r.houghtransform: fixed orientation in angle map

Modified: grass-addons/grass7/raster/r.houghtransform/houghtransform.cpp
===================================================================
--- grass-addons/grass7/raster/r.houghtransform/houghtransform.cpp	2012-08-03 08:43:41 UTC (rev 52511)
+++ grass-addons/grass7/raster/r.houghtransform/houghtransform.cpp	2012-08-03 08:45:21 UTC (rev 52512)
@@ -91,11 +91,12 @@
         {
             if (mOriginalMatrix(x, y) == 1)
             {
+                // gradient in mathematical axes
                 double angle = angles(x, y);
+                
+                // unify gradients
                 if (angle < 0)
-                    angle = std::abs(angle);
-                else if (angle > 0)
-                    angle = 180 - angle;
+                    angle += 180;
 
                 // converting angle [0,180) to index
                 // in internal table of angles



More information about the grass-commit mailing list