I'm facing a problem here while trying to create a video from a sequence of images. This is the code:
video_name='resultvid10.avi'
video = cv2.VideoWriter(video_name,cv2.VideoWriter_fourcc('M','J','P','G'),1,(336,256))
for i in range(0,100):
img = cv2.imread('./Project/data/image/video10/frame'+str(i)+'.jpg')
result = solarPanelDetection(img)
video.write(result)
video.release()
So, the video 10 has 100 frames, I extracted those frames into a folder as you can see in the code.
I passed each of every frames in this folder to a function called solarPanelDetection
, and the output is another image called result
, then I write this result
to the output video. But I couldn't open the video, I check the size of the video and seems like video.write
didn't write the result
to the video.
I think it's not about the size of the frame and the video, the size of each frame and the video are the same, I did check carefully.
What is the problem? Can anyone help me please!