Computer vision programs written in C++.
All projects have a cross-platform CMakeLists.txt
, all of which add CMakeLists.txt
at the root folder as subdirectory to find OpenCV and to share common code in one place.
For contributing, please use git-clang-format
to indent the code, which is available at the root folder in this repository.
Windows:
-
Download and add to PATH
clang-format.exe
from LLVM builds. -
Run in this folder:
$ git clang-format *
Ubuntu:
$ sudo apt-get install git-clang-format
$ git-clang-format-<ver> *
Consider adding it as a pre-commit hook as described in githook-clang-format.
$ mv clang-format.hook .git/hooks/pre-commit
$ chmod +x .git/hooks/pre-commit
Perform pinhole and fisheye camera calibration given chessboard images.
Commonly used functions. The following executables require OpenCV 4.5.2.
Test dense optical flow algorithms.
Latest available optical flow classes: cv::DenseOpticalFlow
- Press V to toggle optical flow representation.
- Press SPACE to toggle pause.
- Press ESC to exit.
Test object tracking algorithms.
Latest available tracker classes: cv::Tracker
Available legacy tracker classes: cv::legacy::Tracker
- Press ENTER to re-select region-of-interest.
- Press SPACE to toggle pause.
- Press ESC to exit.
Implementation of JPEG compression algorithm.
MATLAB file implements encoding and decoding parts described in wiki/JPEG. C++ file demonstrates the effect of changing the quality factor in real time. Huffman coding is used to calculate the compression ratio, but the rest is not implemented.
Split an image into multiple overlapping parts.
Written in Python to provide a simple dataset to test Stitch.
Track segments in an image stream using "Efficient Graph-Based Image Segmentation algorithm" (EGBIS) and feature matching.
First, the image is divided into segments by EGBIS. Then, SIFT features are detected in each segment. Feature matching is performed between two frames. Each segment matches with the segment that has the maximum number of feature matches in the previous frame.
Note that the segments are independent in each frame, so the shape and size of the segments change rapidly. Although feature matching is accurate, there is not always a corresponding segment between consequent frames. Therefore, tracking is not very successful.
EGBIS is in a separate submodule. Stitch library is built inside this repository.
Combine multiple images in a single perspective.
Pipeline:
- Detect and match features.
- Compute homography (perspective transform between frames).
- Warp one image onto the other perspective.
- Combine the base and warped images while keeping track of the shift in origin.
- Given the combination pattern, stitch multiple images.