浏览代码

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 年之前
父节点
当前提交
7077cd62a9
共有 2 个文件被更改,包括 3 次插入4 次删除
  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>
 <p>
 The <b>threshold=</b> parameter determines the "sensitivity" of the
 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
 lower values can be tested by the user.  Increasing the
 threshold value will result in fewer edges being found.
 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->required = NO;
     threshold->multiple = NO;
     threshold->multiple = NO;
     threshold->description = _("Sensitivity of Gaussian filter");
     threshold->description = _("Sensitivity of Gaussian filter");
-    threshold->answer = "10";
+    threshold->answer = "0.01";
 
 
     orientations = G_define_option();
     orientations = G_define_option();
     orientations->key = "orientations";
     orientations->key = "orientations";
@@ -103,10 +103,9 @@ int main(int argc, char *argv[])
     /* open input cell map */
     /* open input cell map */
     inputfd = Rast_open_old(input_map->answer, "");
     inputfd = Rast_open_old(input_map->answer, "");
 
 
-    sscanf(threshold->answer, "%1lf", &Thresh);
+    Thresh = atof(threshold->answer);
     if (Thresh <= 0.0)
     if (Thresh <= 0.0)
 	G_fatal_error(_("Threshold less than or equal to zero not allowed"));
 	G_fatal_error(_("Threshold less than or equal to zero not allowed"));
-    Thresh /= 100.0;
 
 
     sscanf(width->answer, "%f", &Width);
     sscanf(width->answer, "%f", &Width);