FFT of image using imager package

I would like to get FFT power spectrum of an image using imager package.My code is given below.
However it does not work and the following message is coming up. Where is wrong in this code? Your help is appreciated.

##################################################
library(imager)
img = grayscale( boats )
plot(img)

ff <- FFT(img,inverse=FALSE)
plot(ff$real,main="Real part of the transform")
plot(ff$imag,main="Imaginary part of the transform")
power <- sqrt(ff$real^2+ff$imag^2)
plot(power,main="Power spectrum")
###############################################
error message:
Error in FFT_realim(im.real, inverse = inverse) : CImgList::FFT(): Specified real and imaginary parts (256,384,1,1) have non 2^N dimension along the Y-axis.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.