Imagemagick -canny:参数指的是什么?

Imagemagick -canny : what do arguments refer to?

使用 Imagemagick 转换工具的 -canny 选项时,这些参数指的是什么?

-canny radiusxsigma{+lower-percent}{+upper-percent}

文档 (https://www.imagemagick.org/script/command-line-options.php#canny) 给出了百分比增加或减少可能导致的示例,但我找不到 radiusXsigma 的确切含义及其与后面两个数字的关系(即 10%文档示例中为 30%)。

可能值得跳转到维基百科对 Canny edge detector 文章的定义。

文档假定您已经了解 Gaussian functionradiussigma 都是 user-defined 常量;也许,GaussianBlurImage method header 文档对它进行了最好的描述。 (下面引用)

GaussianBlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and GaussianBlurImage() selects a suitable radius for you

The format of the GaussianBlurImage method is:

Image *GaussianBlurImage(const Image *image,onst double radius,
                   const double sigma,ExceptionInfo *exception)

A description of each parameter follows:

  • image: the image.
  • radius: the radius of the Gaussian, in pixels, not counting the center pixel.
  • sigma: the standard deviation of the Gaussian, in pixels.
  • exception: return any errors or warnings in this structure.

更好的 hands-on 带有示例的文档 here

现在最后两个选项...

{+lower-percent}{+upper-percent}

它们本质上是阈值的下限和上限。如果愿意,可以定义 "envelope" 或 "range"。他们基本上会组成 hysteresis 来追踪。