Closed ghost closed 5 years ago
The intention is that by calling Kernel.gaussian
you're explicitly asking for the non-factored version---you might want to use the matrix that it returns (e.g., to plot it), rather than "just" being something you're about to pass to imfilter
. If you know you want the factored version, you call KernelFactors.gaussian
. In other words, you get what you ask for.
Consequently I don't see a problem, but take that with a grain of salt: since I designed this, naturally I think it makes sense, but for all I know I might be the only one. It's also possible that this is under-documented.
Thanks for your comment. Now I understand the difference between Kernel
and KernelFactors
modules. As you pointed out, my intension was this one:
kernelf = KernelFactors.gaussian((3, 3))
imgf = imfilter(img, kernelf)
I agree to your design (separating normal kernel and factored ones), so I will close this PR not to violate it.
Thanks.
Currently,
Kernel.gaussian(1)
returns 2-dimensional array:But, as is explained in Factored kernels, one can use kernelfactors for Gaussian kernel instead of 2d-array. So, why don't you use kernelfactors by default?
For speed comparison, 2d-array filtering took about 24ms on average:
The kernelfactors version took about just 5 or 6ms on average.
Following is my environment.