Applying dense optical flow to image
I need help in applying dense optical flow to an image. This is how I'm generation flow:
flow = cv2.calcOpticalFlowFarneback(prev,next, None, 0.5, 3, 15, 3, 5, 1.2, 0)
I want to apply this flow to prev image to somehow create next image. Any idea how this is possible? I'm using python 2.7 and opencv 3.1
Following is next image:
Following is prev image:
Purpose of this exercise is to replicate DeepWrap gaze manipulation paper. https://sites.skoltech.ru/compvision/...
There is already a solution available but I guess it for some different version. https://stackoverflow.com/questions/4...
it's unclear, where your actual problem is.
please have a look at the python sample , then please refine your question.
What i'm trying to do is, I'm trying to regenerate next image from prev image. I thought that there might be some way to do this by applying optical flow values to prev image
"regenerate next image from prev image" -- what ? you're trying to see into the future ?
Isn't it possible when we have already calculated flow values by using both next and prev images?
@berak may be Deep multi-scale video prediction beyond mean square error
ok,ok, apologies, i misread it. well, you cannot generate a future image from a current one, but you could try to extrapolate the flow from prev -> current to make some prediction.
(cool paper, thanks ;)
I think i was unable to explain my question, but the link which you shared really helped. All i was asking how to write warp_flow method.
@salahuddin_12 , please come back with an answer, if you can get something rolling !
@salahuddin_12, do you mean that you want to move from prev image to next image then to next image and so on?