CUDA Farneback outputs None

Its a problem in the way using the python bindings.

If you pass in an output argument when using the bindings you need to initialize it to the correct size and type.

e.g. If you want to pass in the output argument cflow which I recommend when using CUDA to avoid costly memory allocations. i.e.

farneback.calc(cframe_gray, cframe_next_gray, cflow)

you need to init cflow first

cflow = cv2.cuda_GpuMat(cframe_gray.size(),cv2.CV_32FC2)

The usual alternative which is how I always call functions from python to start with so I can determine the correct size and type is not to pass the output argument but it looks like the bindings here have a slight issue in that flow has to be an input arg

Help on method_descriptor:

calc(…)
calc(I0, I1, flow[, stream]) → flow
. @brief Calculates a dense optical flow.
.
. @param I0 first input image.
. @param I1 second input image of the same size and the same type as I0.
. @param flow computed flow image that has the same size as I0 and type CV_32FC2.
. @param stream Stream for the asynchronous version.

When this is the case you can still call the function without initializing flow by passing in an empty GpuMat and examinnig the resulting output GpuMat.

cflow = cv2.cuda_GpuMat()
cflow = farneback.calc(cframe_gray, cframe_next_gray, cflow)