I am currently working on keyframe extraction from videos.
Code :
while success:
success, currentFrame = vidcap.read()
isDuplicate = False
limit = count if count <= 10 else (count - 10)
for img in xrange(limit, count):
previusFrame = cv2.imread("%sframe-%d.png" % (outputDir, img))
try:
difference = cv2.subtract(currentFrame, previusFrame)
except:
pass
This gives me huge amounts of frames. Expected ouput: Calculate pixel difference between frames and then compare it with a threshold value and store unique keyframes.
Working on videos for the first time. please guide on how to proceed to achieve the expected output