2

I have a sequence of ordered image and I read it as a video with cv2.videocapture, call it train_video. However I noticed that the video is upside down compared to the original sequence of images, therefore I want to use cv2.flip function to flip it.

I have two questions-

  1. What could be the reason that it is upside down??

  2. What is the most efficient way to flip all the frames in the video? I know I can create an empty video and then start to add the flipped frame one by one into this video, but there must be some more efficient method for me to alter the frame within the video object train_video directly, right?

Thanks for your help!

nobody
  • 815
  • 1
  • 9
  • 24
  • I'm not sure why train_video is flipped, but I would advise that instead of using an image sequence, you should from an avi/mp4 video file from your images in a separate py script, using the VideoWriter class. Once you have a proper training video, you may run your main algo on it. – Saransh Kejriwal Apr 08 '16 at 11:59

1 Answers1

1

Check out my answer here on how to fix that.

Some cameras by default capture frames/images in landscape orientation. To display them correctly use the image/video's exif metadata tags to figure out the correct orientation.

Rafay Khan
  • 1,070
  • 13
  • 25