Implement frame warping using optical flow with bilinear interpolation to create an intermediate frame. This task involves understanding how to apply optical flow to warp a source frame.
The concept of optical flow is crucial here, as it represents the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between an observer and the scene. Given the optical flow (u,v) at each pixel, the goal is to warp the source frame to create an intermediate frame. The warping process involves shifting each pixel in the source frame by the corresponding optical flow values.
Here are the steps to achieve this:
This technique is widely used in video processing applications, such as frame interpolation and video slow-motion.
src_frame = image at t=0 flow = motion from t=0 to t=1 warp_factor = 0.5
Intermediate frame at t=0.5
For each pixel in output: