Open
Description
Reproducing code example:
import random
import time
# import matplotlib
import numpy as np
from scipy.fftpack import fft
# import cv2
coordinate = np.ndarray((1920, 1080, 2))
print(coordinate.shape)
for i in range(1920):
for j in range(1080):
coordinate[i][j] = (random.randint(0, 1920), random.randint(0, 1080))
print(coordinate[0][0])
# test = ([2.+4.j, 3.+3.j, 4.+4.j, 5.+3.j, 4.+2.j, 3.+1.j, 2.+2.j, 1.+3.j])
start_time = time.time();
res = np.fft.fft(coordinate)
end_time = time.time();
print("spend time: ", (end_time - start_time));
Error message:
The result is :
% python2 ./test.py
(1920, 1080, 2)
[ 1022. 435.]
('spend time: ', 0.06316184997558594)
% python3 ./test.py
(1920, 1080, 2)
[1143. 678.]
spend time: 0.18218493461608887
Numpy/Python version information:
The pythons' numpy version are both 1.19.1
Python2: 2.7.16
Python3: 3.7.3
macOS: 10.15.6