Skip to content

Commit 78044e7

Browse files
debugging
1 parent d2f47a6 commit 78044e7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

demo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function test(mats)
2929
frame = @view mat[:, :, i]
3030
imfilter!(r_noncached, f2, frame, kernel)
3131
imfilter!(r_cached, f1, frame, kernel)
32-
@show f1[1, 1], f2[1, 1]
32+
@show f1[1:2, 1:2] f2[1:2, 1:2]
3333
all(f1 .≈ f2) || error("f1 !≈ f2")
3434
end
3535
return

src/imfilter.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,15 +872,22 @@ function planned_fft(A::AbstractArray{T,N},
872872
end
873873

874874
function filtfft(A, krn, planned_rfft1::Function, planned_rfft2::Function, planned_irfft::Function)
875-
B = planned_rfft1(A)
876-
complex(B) .*= conj!(complex(planned_rfft2(krn)))
877-
return real(planned_irfft(complex(B)))
875+
B = complex(planned_rfft1(A)) * FFTW.AbstractFFTs.to1(A)
876+
_B = rfft(A)
877+
@show B[1:4] _B[1:4]
878+
B .*= conj!(complex(planned_rfft2(krn)))
879+
out = irfft(B, length(axes(A, 1)))
880+
@show complex(B)[1:2,1:2] axes(complex(B)) out[1:2,1:2]
881+
return out
882+
# return real(planned_irfft(complex(B)))
878883
end
879884
filtfft(A, krn, ::Nothing, ::Nothing, ::Nothing) = filtfft(A, krn)
880885
function filtfft(A, krn)
881886
B = rfft(A)
882887
B .*= conj!(rfft(krn))
883-
irfft(B, length(axes(A, 1)))
888+
out = irfft(B, length(axes(A, 1)))
889+
@show B[1:2,1:2] axes(B) out[1:2,1:2]
890+
return out
884891
end
885892
function filtfft(A::AbstractArray{C}, krn) where {C<:Colorant}
886893
Av, dims = channelview_dims(A)

0 commit comments

Comments
 (0)