You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Expected behavior: When I apply padding or a background gradient to an image, the padding should create a space around the image content and the gradient should fill that space.
Actual behavior: Image remains the same size
Things I've tried:
I've verified that the padding and gradient styles are being applied to the correct element and that image has a defined height and width.
SO I tried reflect but the test and reflected images They have the same size
test_image = rand(5, 5) # Create a small test image
reflected_test_image = reflect(test_image)
println(size(test_image))
println(size(reflected_test_image))
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:
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: