-
Notifications
You must be signed in to change notification settings - Fork 141
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
Padding issue #1059
Comments
This comment was marked as outdated.
This comment was marked as outdated.
julia> sobel_x_kernel = [[-0.125, 0.0, 0.125]; [0.0, 0.0, 0.0]; [-0.125, 0.0, 0.125]]
9-element Vector{Float64}:
-0.125
0.0
0.125
0.0
0.0
0.0
-0.125
0.0
0.125 Did you mean: julia> [-0.125 0.0 0.125; 0.0 0.0 0.0; -0.125 0.0 0.125]
3×3 Matrix{Float64}:
-0.125 0.0 0.125
0.0 0.0 0.0
-0.125 0.0 0.125 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to get gradient of an image matrix
Images v0.26.1
Julia Version 1.10.4
`using Images
#morph_image size is 301x301
sobel_x_kernel = [[-0.125, 0.0, 0.125]; [0.0, 0.0, 0.0]; [-0.125, 0.0, 0.125]]
sobel_y_kernel = transpose(sobel_x_kernel) # Transpose for y-direction
pad_size = 1 # Adjust pad size if needed
padded_image = Images.pad(morph_image, pad_size, pad_size)
gradient_x = imfilter(padded_image, sobel_x_kernel)
gradient_y = imfilter(padded_image, sobel_y_kernel) # Works without an issue
`
Here's a breakdown of the problem:
Things I've tried:
M is 5x5 window of morph_image
julia> M
julia> gradient_y = imfilter(M, sobel_y_kernel)
julia> gradient_x = imfilter(M, sobel_x_kernel)
I also tried this:
Has anyone else experienced this issue? Any suggestions on how to troubleshoot or fix this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: