diff --git a/readFlowFile.py b/readFlowFile.py index 7efaa08..d76e877 100644 --- a/readFlowFile.py +++ b/readFlowFile.py @@ -26,7 +26,7 @@ def read(file): w = np.fromfile(f, np.int32, count=1) h = np.fromfile(f, np.int32, count=1) #if error try: data = np.fromfile(f, np.float32, count=2*w[0]*h[0]) - data = np.fromfile(f, np.float32, count=2*w*h) + data = np.fromfile(f, np.float32, count=2*int(w)*int(h)) # Reshape data into 3D array (columns, rows, bands) flow = np.resize(data, (int(h), int(w), 2)) f.close()