As general remarks:
- slicing
A[i, :]creates a copy (-> more memory allocations), consider using@view - you can do a few operations in-place, like
andfft!(fftshift(ph0_rgb, 3), 3)im0_rgb[i, :, :] .*= scale_factor
As general remarks:
A[i, :] creates a copy (-> more memory allocations), consider using @view
fft!(fftshift(ph0_rgb, 3), 3)
andim0_rgb[i, :, :] .*= scale_factor