According to the matlab code of Deqing Sun and c++ source code of Daniel Scharstein Contact: dqsun@cs.brown.edu Contact: schar@middlebury.edu
(filename, uv)
| 32 | |
| 33 | |
| 34 | def writeFlowFile(filename, uv): |
| 35 | """ |
| 36 | According to the matlab code of Deqing Sun and c++ source code of Daniel Scharstein |
| 37 | Contact: dqsun@cs.brown.edu |
| 38 | Contact: schar@middlebury.edu |
| 39 | """ |
| 40 | TAG_STRING = np.array(202021.25, dtype=np.float32) |
| 41 | if uv.shape[2] != 2: |
| 42 | sys.exit("writeFlowFile: flow must have two bands!"); |
| 43 | H = np.array(uv.shape[0], dtype=np.int32) |
| 44 | W = np.array(uv.shape[1], dtype=np.int32) |
| 45 | with open(filename, 'wb') as f: |
| 46 | f.write(TAG_STRING.tobytes()) |
| 47 | f.write(W.tobytes()) |
| 48 | f.write(H.tobytes()) |
| 49 | f.write(uv.tobytes()) |
| 50 | |
| 51 | |
| 52 | def load_dict(filename_): |
nothing calls this directly
no outgoing calls
no test coverage detected