-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ksize
has no effect in skimage.filters.laplace
#5491
Comments
Specifically, ksize is passed as a shape parameter here: scikit-image/skimage/filters/edges.py Line 690 in a86701c
but that shape is only used in the argument to the FFT for the first argument returned by scikit-image/skimage/restoration/uft.py Line 453 in a86701c
|
OpenCV supports odd sizes 3, 5, 7, ... where size = 3 correspond to
For larger ksize, I am not sure where the algorithm OpenCV uses to compute the length For ksize = 1, the specific non-separable 2D kernel [[0, 1, 0],
[1, -4, 1],
[0, 1, 4]] is used. This |
can I solve this issue? |
I run code and I saw that every time returns (3,3,3) laplace_op, first, i passed k_size as 3 it is returning (3,3,3) second time I passed k size as 5 still it is returning (3,3,3) so I am going to solve this bug |
This is issue scikit-image#5491 and the main problem was a function only generating kernel size of 3x3 now I added more kernel_size now kernel size can grow up to 31x31 all odd numbers this issue is all about laplacian operator for edge detection
See #5552 (comment) for a specific example showing exactly what OpenCV does. |
Description
The discrete Laplacian kernel used internally by
skimage.filters.laplace
is unaffected by the setting ofksize
. The actual kernel generated is always shape(3, ) * ndim
. The shape parameter used byskimage.restoration.laplacian
only effects the FFT size when creating a Fourier representation of the kernel, but that argument is not even used withinskimage.filters.laplace
.We should either deprecate this
ksize
argument or implement other sizes.Ideally the spatial laplacian kernel generation should be split into a separate function than the Fourier transfrom used in
skimage.restoration.uft
.The text was updated successfully, but these errors were encountered: