# How to get exact speed vectors (motion vectors)?

I have a simple cube, moving only in the x-direction, camera looking at it from top.

Having Vector pass enabled in the View Layer Properties, I am getting the speed vectors as exr files. Then loading them in my python code at looking at the speed (motion) vectors. Everything is fine except for the object boundaries. All the pixels of the object are moving with the same speed, but speed vectors are different for all boundary pixels. When the object is round or it has texture, things get worse. I need to make sure that these speed vectors are exact, could anyone help me with this?

PS: This is a simplified example. I am working with several complex objects with different textures, so I am sure that the general structure of my code and project is right, but there must be something about blender settings that I am missing. I am a newbie in the Blender and only using its scripting to generate some data.

• I think the Vector Pass does not provide subpixel motion vector info. It may be doing some average of which object is encountered on that pixel... which may explain the weird results. You may be able to do your own subsampling by rendering a higher res but less samples version of your scene to get finer motion vector info. Commented Apr 4, 2020 at 10:15
• Thanks, Bruno, it doesn't seem to be a subpixel problem. For example, the vector component in the x-direction is 23.6 for all interior pixels and say 18.6 for boundary pixels and 10.2 for one pixel outside the object. I don't know how a render engine works, but if using CYCLES we are able to animate complex phenomena like water and smoke, shouldn't it be able to measure exact speed vectors? Commented Apr 4, 2020 at 15:11
• At object boundaries, one pixel no matter how small can receive rays from multiple object. That means you can never get a single local accurate value. The algorithm responsible to give you the vector has to pick one object (based on depth for example) or give you an average of all the objects covering that pixel. Commented Apr 4, 2020 at 15:36