I want to extract only clear frames (unshaken) from video file. This will be useful for my annotation process.
I am using below code to extract frames from a video file.
counter=0
cap = cv2.VideoCapture(file_)
success, frame = cap.read()
while success:
counter += 1
cv2.imwrite(f"{counter}.jpg", frame)
for i in range(15):
cap.read()
success, frame = cap.read()
In the above snippet i am skipping every 15 consecutive frames to avoid extracting all the frames. Is there anyway I can find blurriness in frame and skip only those?
Any hint would be appreciable.