3
$\begingroup$

I have a scene with moving objects and I want to extract the optical flow (apparent motion as seen by the camera). I am using Cycles. I include the 'Vector' pass and save the result as 'OpenEXR MultiLayer'. When I open the resulting file in Python I get the following channels:

  • RenderLayer.Vector.W
  • RenderLayer.Vector.X
  • RenderLayer.Vector.Y
  • RenderLayer.Vector.Z

What is the convention here? Could you provide a source for the information?

$\endgroup$
2
  • 1
    $\begingroup$ R: pixel displacement in X from current frame to previous frame G: pixel displacement in Y from current frame to previous frame B: pixel displacement in X from current frame to next frame A: pixel displacement in Y from current frame to next frame. – From blenderartists.org/t/nuke-and-blender-speed-vector-pass-in-nuke/… - Maybe the info in this thread is helpful to do more research. RGBA might map to WXYZ or XYZW. (Not a real answer, so just commenting here.) $\endgroup$
    – michaelh
    Mar 24, 2021 at 12:30
  • 1
    $\begingroup$ @micaelh Thank you, this information helped me to build the experiments that led to the actual answer. $\endgroup$
    – Milo
    Mar 26, 2021 at 7:10

1 Answer 1

5
$\begingroup$

Guided by @micaelh in the comments, I ended up doing some experiments moving objects in a controlled way, the results are below.

  • Vector.X - X displacement from previous frame to current frame
  • Vector.Y - Y displacement from previous frame to current frame
  • Vector.Z - X displacement from current frame to next frame
  • Vector.W - Y displacement from current frame to next frame

Values are in pixels. X displacement is positive to the left, Y displacement is positive downwards.

$\endgroup$
1
  • $\begingroup$ Is there a way to obtain optical flow between frames t and t + k where k > 1? Thanks! $\endgroup$
    – aviator
    Feb 29 at 19:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .