Browse Source

i.zc: threshold was not read correctly and had no effect

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70477 15284696-431f-4ddb-bdfa-cd5b030d7da7
Moritz Lennert 8 years ago
parent
commit
7077cd62a9
2 changed files with 3 additions and 4 deletions
  1. 1 1
      imagery/i.zc/i.zc.html
  2. 2 3
      imagery/i.zc/main.c

+ 1 - 1
imagery/i.zc/i.zc.html

@@ -34,7 +34,7 @@ changes in cell values.
 
 <p>
 The <b>threshold=</b> parameter determines the "sensitivity" of the
-Gaussian filter.  The default value is <b>10</b>;  higher and
+Gaussian filter.  The default value is <b>0.01</b>;  higher and
 lower values can be tested by the user.  Increasing the
 threshold value will result in fewer edges being found.
 

+ 2 - 3
imagery/i.zc/main.c

@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
     threshold->required = NO;
     threshold->multiple = NO;
     threshold->description = _("Sensitivity of Gaussian filter");
-    threshold->answer = "10";
+    threshold->answer = "0.01";
 
     orientations = G_define_option();
     orientations->key = "orientations";
@@ -103,10 +103,9 @@ int main(int argc, char *argv[])
     /* open input cell map */
     inputfd = Rast_open_old(input_map->answer, "");
 
-    sscanf(threshold->answer, "%1lf", &Thresh);
+    Thresh = atof(threshold->answer);
     if (Thresh <= 0.0)
 	G_fatal_error(_("Threshold less than or equal to zero not allowed"));
-    Thresh /= 100.0;
 
     sscanf(width->answer, "%f", &Width);