Skip to content

Use Optical Flow for image to image correspondences  #33

@johanos

Description

@johanos

Hi,

I have a question on how to use the optical flow generated in calculate_optical_flow.py

I saw this issue #2 (comment), and I get what you guys are doing at a high level. However, I am not getting good results with what I am trying to do: generate point correspondences between frames using the optical flow, I thought it would just be as simple as getting the optical flow at a pixel position and doing something like

  x' = x  + flow[0] (horizontal component) 
  y' = y  + flow[1] (vertical component) 

but this seems to not be the case

for example without even looking at the hsv image that gets generated.

image

for the first frame, of the first sequence, of the validation set. I look at the optical flow defined for pixel
<u,v> = [150, 175]

optical flow has a shape of height, width, 2 so to get the optical flow for pixel u,v I index this array at v,x. (I tried changing this combination as well)

optical_flow_derivatives[175, 150] = [-52.63050978 64.67535536]

point <u,v> = 150, 175 should be translated to somewhere near point <u', v'> = 60, 190 in the next frame. However, the optical flow at this pixel used as how I'm interpreting it puts the point at <u', v'> = [ 97.36949022, 239.67535536]

I'm guessing I'm missing something obvious, but any insight would be appreciated!

-Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions