Convert flow into middlebury color code image.
(flow)
| 334 | |
| 335 | |
| 336 | def highlight_flow(flow): |
| 337 | """Convert flow into middlebury color code image. |
| 338 | """ |
| 339 | out = [] |
| 340 | s = flow.shape |
| 341 | for i in range(flow.shape[0]): |
| 342 | img = np.ones((s[1], s[2], 3)) * 144. |
| 343 | u = flow[i, :, :, 0] |
| 344 | v = flow[i, :, :, 1] |
| 345 | for h in range(s[1]): |
| 346 | for w in range(s[1]): |
| 347 | ui = u[h, w] |
| 348 | vi = v[h, w] |
| 349 | img[ui, vi, :] = 255. |
| 350 | out.append(img) |
| 351 | return np.float32(np.uint8(out)) |
| 352 | |
| 353 | |
| 354 | def pt_highlight_flow(flow): |
nothing calls this directly
no outgoing calls
no test coverage detected