Open hcfugro opened 4 months ago
Can you provide minimal code and environment that actually works or reproduces the problem?
Could you show the output of pkg> st -m
?
Where is Images.pad
implemented? (What is the output of @which Images.pad
?)
sobel_x_kernel
is not a Matrix
.
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
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.