diff --git a/src/segmentation_a_direct.jl b/src/segmentation_a_direct.jl index 527031b9..fa809c18 100644 --- a/src/segmentation_a_direct.jl +++ b/src/segmentation_a_direct.jl @@ -112,7 +112,9 @@ Compute the gradient magnitude of an image using the Sobel operator. """ function imgradientmag(img) h = centered([-1 0 1; -2 0 2; -1 0 1]') - Gx = imfilter(img, h', "replicate") - Gy = imfilter(img, h, "replicate") + Gx_future = Threads.@spawn IceFloeTracker.imfilter(img, h', "replicate") + Gy_future = Threads.@spawn IceFloeTracker.imfilter(img, h, "replicate") + Gx = fetch(Gx_future) + Gy = fetch(Gy_future) return hypot.(Gx, Gy) end