ubc-vision / COTR

Code release for "COTR: Correspondence Transformer for Matching Across Images"(ICCV 2021)
Apache License 2.0
460 stars 58 forks source link

Dense optical flow as in paper Figure 1 (c) #28

Closed Wuziyi616 closed 2 years ago

Wuziyi616 commented 2 years ago

Hi, thanks for the great work! I wonder how can I estimate the optical flow between two images. Say img1 is of shape [H, W], then can I basically reshape the grid coordinates to [H*W, 2] and then input to queries_a as in this demo?

Wuziyi616 commented 2 years ago

Another question is that, what does force here mean?

jiangwei221 commented 2 years ago

Hi, you can try to use demo_single_pair.py which will triangulate a dense optical flow based on the sparse points. Directly reshaping the grid coordinates and feed it as input will be computational expensive. force argument outputs correspondences for all the input points, and avoid the drifting check.

Wuziyi616 commented 2 years ago

Thanks for your prompt reply. That makes a lot of sense