title: Linear Interpolation of video frames in OpenCV Python
body: <p>I was trying to achieve the so called  'ghosting effect' from the LFI method for inserting frames in OpenCV, Python.</p>
  
  <p>However, the output does not seem to produce the results. I used blending function of OpenCV to calculate the frames in between.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>from __future__ import division
  
  import numpy as np
  import cv2
  
  
  cap = cv2.VideoCapture('test_vid.avi')
  
  starting = True
  prev_frame = np.uint8([250])
  
  while(True):
  
      # Capture frame-by-frame
      ret, frame = cap.read()
  
      if starting==True:
          prev_frame = frame
          starting = False
      else:
          for i in range(1,10):
              weight = i/10
              #get the blended frames in between
              mid_frame = cv2.addWeighted(prev_frame,weight,frame,1-weight,0)     
              cv2.imshow('frame2',mid_frame)
  
          #cv2.imshow('frame',frame)     
          prev_frame = frame
  
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>The result seems to be as if its the same frame as the current frame (no sign of any actual blending taking place)</p>