The idea of the camera course is to build a collision detection system - that's the overall goal for the Final Project. As a preparation for this, you will now build the feature tracking part and test various detector / descriptor combinations to see which ones perform best. This mid-term project consists of four parts:
- First, you will focus on loading images, setting up data structures and putting everything into a ring buffer to optimize memory load.
- Then, you will integrate several keypoint detectors such as HARRIS, FAST, BRISK and SIFT and compare them with regard to number of keypoints and speed.
- In the next part, you will then focus on descriptor extraction and matching using brute force and also the FLANN approach we discussed in the previous lesson.
- In the last part, once the code framework is complete, you will test the various algorithms in different combinations and compare them with regard to some performance measures.
See the classroom instruction and code comments for more details on each of these parts. Once you are finished with this project, the keypoint matching part will be set up and you can proceed to the next lesson, where the focus is on integrating Lidar points and on object detection using deep-learning.
- cmake >= 2.8
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- OpenCV >= 4.1
- All OSes: refer to the official instructions
- This must be compiled from source using the
-D OPENCV_ENABLE_NONFREE=ON
cmake flag for testing the SIFT and SURF detectors. If using homebrew:$> brew install --build-from-source opencv
will install required dependencies and compile opencv with theopencv_contrib
module by default (no need to set-DOPENCV_ENABLE_NONFREE=ON
manually). - The OpenCV 4.1.0 source code can be found here
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using either MinGW-w64 or Microsoft's VCPKG, a C++ package manager. VCPKG maintains its own binary distributions of OpenCV and many other packages. To see what packages are available, type
vcpkg search
at the command prompt. For example, once you've VCPKG installed, you can install OpenCV 4.1 with the command:
c:\vcpkg> vcpkg install opencv4[nonfree,contrib]:x64-windows
Then, add C:\vcpkg\installed\x64-windows\bin and C:\vcpkg\installed\x64-windows\debug\bin to your user's PATH variable. Also, set the CMake Toolchain File to c:\vcpkg\scripts\buildsystems\vcpkg.cmake.
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./2D_feature_tracking
.
- MP.1 - A ring buffer of size 2 has been implemented using standard library Queue
- MP.2 - The various detectors are implemented which can be chosen by the string detectorType
- MP.3 - All the keypoints outside the pre-defined rectangle have been removed using OpenCV's Rect.contains function
- MP.4 - The various descriptors are implemented which can be chosen by the string descriptorType
- MP.5 - FLANN and KNN matching have been implemented
- MP.6 - Descriptor distance ratio has been implemented
- MP.7 -
BRISK | AKAZE | SIFT | ORB | SHITOMASI | FAST | HARRIS |
276.2 | 167 | 138.6 | 116.1 | 117.9 | 94.9 | 24.8 |
-
Brisk - Densly clouded points, mainly at top half of the vehicle, consistent
-
AKAZE - Keypoints are spread out along the contour of the preceding vehicle and are consisten
-
SIFT - Taillights are recognised consistently but overall the keypoints do not seem very consisten
-
ORB - Consistent but sparse and big neighbourhoods considered for every keypoint
-
SHITOMASI - Spread out, consistent and small neighbourhoods considered for every keypoint
-
FAST - Keypoints are sparse, spread along the contour of the preceding vehicle and the neighbourhoods are approx 10x10 pixels
-
HARRIS - Very sparse keypoints (could be because of corner response threshold) but are consitent and neighborhoods similiar to FAST detector
- MP.8 -
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
118 | 118 | 118 | 118 | - | 118 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
23 | 23 | 23 | 23 | - | 23 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
95 | 95 | 95 | 95 | - | 95 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
278 | 278 | 278 | 278 | - | 278 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
105 | 114 | 114 | 61 | - | 114 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
165 | 165 | 165 | 165 | 165 | 165 |
BRISK | BRIEF | ORB | FREAK | AKAZE | SIFT |
---|---|---|---|---|---|
138 | 138 | - | 137 | - | 138 |
- MP.9 -
BRIEF | BRISK | ORB | SIFT | FREAK | AKAZE |
---|---|---|---|---|---|
0.773459757143 | 2.112561857143 | 7.854222833333 | 28.368754285714 | 31.722652857143 | 46.60965 |
- FAST + BRIEF or BRISK
- ORB + BRIEF or BRISK
- SHITOMASI + BRIEF or BRISK