SlitScan Panorama: Real-time panorama using OpenCV
Make smartphone like panorama on desktop using SlitScan Panorama.
Today, we will see how we can use slit-scan approach for generating high quality panorama images. Slit-scan technique is used widely for different applications. Let’s see how it can be used for generating panorama images from videos or even live camera streams.
First of all, we should install OpenCV (preferred version is 3.x), and make sure that it has been added to PKG_CONFIG variable successfully. In order to make sure that opencv is correctly installed, type the following command in the terminal.
- pkg-config –cflags opencv
This should return the path of ‘include’ folder containing opencv files (In my case, it was -I/usr/local/include/opencv -I/usr/local/include)
Now, let’s download the source code of SlitScan Panorama from https://github.com/installthetech/slit_scan_panorama.git
Follow the instructions given below to download and install SlitScan Panorama:
Step 1 – Downloading : Move to a suitable directory in the terminal i.e. the directory where you want to install SlitScan Panorama. Once you are in the desired directory, type the following command to download the source code:
- git clone https://github.com/installthetech/slit_scan_panorama.git
This will download the source code.
Alternatively, you can directly download the code using the button below, and extract it into suitable directory:
Step 2 – Compiling : Compile the source code using the commands:
- cd slit_scan_panorama/
- chmod +x compile.sh
This will compile the code and save the executable in ‘bin’ folder. This executable can be used to make panorama.
Step 3 – Using : Now the executable can be used as follows.
(from the root directory)
- ./bin/panorama video_path output_image_name
- ./bin/panorama camera_index output_image_name
video_path is the path of video file on which panorama is to be made.
camera_index is the index of the camera. It can be 0/1/2
output_image_name is the desired name of the output panorama.
Example for videos:
./bin/panorama data/pano_raw.mp4 pano.jpg
Example for camera:
./bin/panorama 0 pano.jpg
The output image will be saved in ‘output’ folder.
Demonstration on Video 1
Demonstration on Video 2
Hope you do good with SlitScan Panorama.