I am trying to save a frame from a video playback. The code runs without any errors, however, i could not find my saved image in my folder. Below is the script that i have written. I am using python version 3.5 and OpenCV3 on a mac. Any help is greatly appreciated. Thanks in advance.
import sys
sys.path.append('/Applications/OpenCV3/build/lib/python3')
import cv2
import numpy as np
import matplotlib.pyplot as plt
i = 0
Mx = cv2.VideoCapture('LB.mp4')
if Mx.isOpened()== True:
print('',Mx.isOpened())
else:
print('',Mx.isOpened())
while(Mx.isOpened()):
print('i = ', i)
ret, frame = Mx.read()
cv2.imshow('Original',frame)
cv2.waitKey(50)
i += 1
if i == 10:
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imwrite = ('Missile.bmp', gray)
print('Imaged saved at i = ', i)
break
print('End of While Loop')
Mx.release()
cv2.destroyAllWindows()
