TypeError: src Datentyp = 15 wird nicht unterstützt

Ich möchte die schnelle Fouriertransformation verwenden, aber es funktioniert nicht, bereits eine einfache Hin- und Her-Transformation durchzuführen. Der Code ist

import cv2
import numpy as np

img = cv2.imread('Picture.bmp',0)
f = np.fft.fft2(img)
fshift = np.fft.fftshift(f)
f_ishift = np.fft.ifftshift(fshift)
img_back = cv2.idft(f_ishift)
img_back = cv2.magnitude(img_back[:,:,0],img_back[:,:,1])

und der Fehler ist

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    img_back = cv2.idft(f_ishift)
TypeError: src data type = 15 is not supported

Wie kann das behoben werden?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage