Skip to content

wallinslax/PanoramaVideo

Repository files navigation

video2Panorama

Description

In this project, we generate 3 novel applications (videos) given an original video with moving-camera. Application 1 is composing panorama with foreground motion trail. Application 2 is producing a panorama video by apply foreground on panorama. Application 3 is to create original video without foreground.

In the beginning, We divide original video into background (1) and foreground (2) separately using yolo. After that, we implement motion vector (MV) calculation according to JPEG. MV can help to determine the hole of background comes from which area of previous frame. In this way, we can remove foreground for each frame and derive application 3 (3). Panorama without foreground (4) can be generated by sticking selected frames in (3). Application 1 is generated by sticking selected frames in (2) to (4). Application 2 is created by sticking (2) to (4) for each frame.

Result

  1. Original Video
SAL.mp4
  1. Prcessed Foreground [middle output 1]

extracted_foreground

  1. Prcessed Backgound [middle output 2]

extracted_background

  1. Panorama without foregound

panorama_sal_full

  1. Application Outputs 1: Panorama with foreground motion trail

3  motion_trail_SAL_06

  1. Application Outputs 2: Panorama Video

Panorama Video

  1. Application Outputs 3: Panorama Video by removing one of foreground object

Panorama Video without foreground

Code Structure

main
├── ioVideo                 # handle read video and play video
├── motionVector            # derive motion vector for each macroblock
├── fgextract               # seperate foreground and background for each frame
├── cache                   # store precessed video and motion vector np array here to accelerate process
├── result                  # parorama image and output video
├── video                   # sample video to be processed
└── README.md

Setup

git clone https://github.com/wallinslax/PanoramaVideo.git
pip install -r requirements.txt

Generate the result above

python main.py -f video/SAL.mp4

Member

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published