Generate a long image strip from a train video
Project description
This document is outdated. README_ja.md is more frequently updated.
Installation
Requirements
Install PyQt5, OpenCV3, Python3 packages. On installing OpenCV3, specify --with-ffmpeg --with-tbb --with-python3 --HEAD options. ###Install by pip Install the trainscanner from the PyPI with pip3 command:
% pip3 install trainscanner % trainscanner
Install by homebrew (mac)
It installs everything required. (PyQt5, OpenCV3 with options, Python3)
% brew tap vitroid/homebrew-TrainScanner % brew install trainscanner % trainscanner
How to capture the video
Capture the whole train from the side with a video camera.
Tripod is necessary.
Pay attention to use tripod on the station platform.
Other advises are listed in the last section. ##Open in TrainScanner 1. Open the video file by pressing the “Open the movie” button. If you fail to open the movie, try conversion with ffmpeg etc.
When file is successfully opened, a large dialog window appears. There are three panels in the window. Top panel is the frame selector, left panel is for the deformation, and right panel is for specifying the motion detection window.
First of all, find the first frame, that is, the frame in which the train is about to enter in the sight, by clicking the thumbnail bar.
Select a frame by the slider below the thumbnail bar.
If the video is captured in portrait, or the camera is a little bit slanted, rotate the photo using the buttons below the left panel.
Four sliders at the four corners of the left panel is the perspective correction. (You can skip this step).
In the right panel, specify the location of the motion detection window. By default, the window is at the central one third of the image.
Red lines in the right panel indicates the positions of the slit. That is, the long image strip is made from the thin image at this red line of each video frame. You can move the slid with the slider at the bottom.
Stitch in TrainScanner
When you finished editing the frames, let’s go stitching.
Go back to the first, small dialog. (Do not close the large window.) Just press the “Start” button. Firstly, a motion detection dialog window appears, in which interframe difference is shown. If the two successive frames are identical, the window becomes white, while difference is indicated in colors. If the software detect the train motion correctly, the image region of the train becomes white and the background becomes colored. (Note: it takes fairly long time for now because the seeking feature in OpenCV2 is very inaccurate. Sorry for convenience.)
After the motion detection is completed, a stitching dialog appears. In the window, you can watch the making process of the long train image strip. After completing the stitch, the product image is saved at the same folder where the original video resides.
For better product photo
…
Advises
…
Revision History
2016-11-11 GUI Version 0.1 is released.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file TrainScanner-0.9.6.tar.gz
.
File metadata
- Download URL: TrainScanner-0.9.6.tar.gz
- Upload date:
- Size: 38.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52b839d10a03b81a4992bc8a2dc046f3bfb1c3925ee4e9de435e8c25b307d3d5 |
|
MD5 | 64d7df2333dbd9034fddd8e7f880d751 |
|
BLAKE2b-256 | f10f89fe747960c5a234c2ac060a54bd89f06f58f34a8338a71f312f3908069d |
File details
Details for the file TrainScanner-0.9.6-py2.py3-none-any.whl
.
File metadata
- Download URL: TrainScanner-0.9.6-py2.py3-none-any.whl
- Upload date:
- Size: 58.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33e424beab1469f7fc9e926cbe1a3868ab5a736df104486c96604b5507bcc6e0 |
|
MD5 | d21f4e443c398944a2954845b551a3c8 |
|
BLAKE2b-256 | dcacae9f04b3bd6560fb904f0a8855ed395544eeb0e4ce4237e0199bfca6cb41 |