# Stereo-Odometry-SOFT
This repository is a MATLAB implementation of the [Stereo Odometry based on careful Feature selection and Tracking](https://ieeexplore.ieee.org/iel7/7320493/7324045/07324219.pdf). The code is released under [MIT License](LICENSE.md).
The code has been tested on [MATLAB R2018a](https://in.mathworks.com/?s_tid=gn_logo) and depends on the following toolboxes:
* Parallel Processing Toolbox
* Computer Vision Toolbox
On a laptop with `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz` and `16GB RAM`, the following average timings were observed:
* Time taken for feature processing (in ms): 261.4
* Time taken for feature matching (in ms): 3650.5
* Time taken for feature selection (in ms): 6.5
* Time taken for motion estimation (in ms): 1.1
## How to run the repository?
1. Clone the repository using the following command:
```
git clone https://github.com/Mayankm96/Stereo-Odometry-SOFT.git
```
2. Import the dataset to the folder [`data`](data). In case you wish to use the [KITTI](http://www.cvlibs.net/datasets/kitti/) Dataset, such as the [Residential dataset](http://www.cvlibs.net/datasets/kitti/raw_data.php?type=residential), the following command might be useful:
```bash
cd PATH/TO/Stereo-Odometry-SOFT
## For Reseidential Sequence: 61 (2011_09_46_drive_0061)
# synced+rectified data
wget -c https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0009/2011_09_26_drive_0009_sync.zip -P data
# calib.txt
wget -c https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_calib.zip -P data
```
3. Change the corresponding paramters in the configuration file [`configFile.m`](code/config/configFile.m) according to your need
4. Run the script [`main.m`](code/main.m) to get a plot of the estimated odometry
## Proposed Implementation of the Algorithm
The input to the algorithm at each time frame, are the left and right images at the current time instant, and the ones at the previous timestamp.
<p align="center">
<img src ="images/algo_over.png" width="50%" height="50%" />
</p>
### Keypoints Detection
In this section, the keypoints detection and matching is divided into following separate stages:
* __feature processing:__ each image is searched for locations that are likely to match well in other images
* __feature matching:__ efficiently searching for likely matching candidates in other images
* __feature tracking:__ unlike to the second stage, the correspondences are searched in a small neighborhood around each detected feature and across frames at different time steps
#### Feature processing
<p align="center">
<img src ="images/feature_processing.jpg" />
</p>
Corner and blob features are extracted for each image using the following steps:
1. First, blob and checkerboard kernels are convolved over the input image.
<p align="center">
<img src ="images/detector-masks.PNG" />
</p>
2. [Efficient Non-Maximum Suppression](https://pdfs.semanticscholar.org/52ca/4ed04d1d9dba3e6ae30717898276735e0b79.pdf) is applied on the filter responses to produce keypoints that may belong to either of the following classes: blob maxima, blob minima, corner maxima, and corner minima. To speed up the feature matching, correspondences are only found between features belong to the same class.
3. The feature descriptors are constructed by using a set of 16 locations out of an 11 x 11 block around each keypoint in input image's gradients. The gradient images are computed by convolving 5 x 5 sobel kernels across the input image. The descriptor has a total length of 32,
#### Feature matching
<p align="center">
<img src ="images/feature_matching.jpg" />
</p>
This part of the algorithm is concerned with finding the features for egomotion estimation. It is based on the process mentioned in the paper [StereoScan: Dense 3d reconstruction in real-time](https://ieeexplore.ieee.org/document/5940405). The process can be summarized as follows:
1. Correspondences in two images are found by computing the Sum of Absolute Differences (SAD) score between a feature in the first image with the one lying in the second image that belongs to the same class
2. This matching is done in a circular fasion between the left and right frames at time instants t-1 and t as shown below:
<p align="center">
<img src ="images/match5.PNG" />
</p>
3. To remove certain outliers, Normalized Cross-Correlation (NCC) is again in a circular fasion using templates of size 21 x 21 pixels around the features that have been matched successfully in the process mentioned above.
#### Feature Selection
<p align="center">
<img src ="images/feature_bucketing.jpg" />
</p>
To ensure a uniform distribution of features across the image, the entire image is divided into buckets of size 50 x 50 pixels and feature selection is done to select only the strongest features present in each bucket.
### Egomotion Estimation
Using P3P algorithm along with RANSAC, incremental rotation and translation is estimated.
<p align="center">
<img src ="images/result_1875.jpg" />
</p>
## To-Dos
- [ ] fix parfor and for loops to enable running without parallel processing
- [ ] read the camera calibration parameters from calibration file directly
- [ ] add sub-pixel refinement using parabolic fitting
- [ ] add feature selection based on feature tracking i.e. the age of features
- [ ] implement Nister's algorithm and SLERP for rotation estimation
- [ ] use Gauss-Newton optimization to estimate translation from weighted reprojection error
没有合适的资源?快使用搜索试试~ 我知道了~
PSO-聚类算法[Matlab代码].zip
共42个文件
m:27个
png:7个
jpg:4个
需积分: 2 0 下载量 149 浏览量
2024-03-11
21:26:15
上传
评论
收藏 3.88MB ZIP 举报
温馨提示
matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。 Matlab(Matrix Laboratory)是一种专为数值计算和科学与工程应用而设计的高级编程语言和环境。在算法开发和实现方面,Matlab具有以下一些好处: 1. 丰富的数学和科学函数库:Matlab提供了广泛的数学、信号处理、图像处理、优化、统计等领域的函数库,这些函数库可以帮助开发者快速实现各种复杂的数值计算算法。这些函数库提供了许多常用的算法和工具,可以大大简化算法开发的过程。 2. 易于学习和使用:Matlab具有简单易用的语法和直观的编程环境,使得算法开发者可以更快速地实现和测试他们的算法。Matlab的语法与数学表达式和矩阵操作非常相似,这使得算法的表达更加简洁、清晰。 3. 快速原型开发:Matlab提供了一个交互式的开发环境,可以快速进行算法的原型开发和测试。开发者可以实时查看和修改变量、绘制图形、调试代码等,从而加快了算法的迭代和优化过程。这种快速原型开发的特性使得算法开发者可以更快地验证和修改他们的想法。 4. 可视化和绘图功能:Matlab具有强大的可视化和绘图功能,可以帮助开发者直观地展示和分析算法的结果。开发者可以使用Matlab绘制各种图形、曲线、图像,以及创建动画和交互式界面,从而更好地理解和传达算法的工作原理和效果。 5. 并行计算和加速:Matlab提供了并行计算和加速工具,如并行计算工具箱和GPU计算功能。这些工具可以帮助开发者利用多核处理器和图形处理器(GPU)来加速算法的计算过程,提高算法的性能和效率
资源推荐
资源详情
资源评论
收起资源包目录
PSO-聚类算法[Matlab代码].zip (42个子文件)
Stereo-Odometry-SOFT-master
LICENSE.md 1KB
data
readme.md 189B
samples_image_3
000000.png 788KB
000001.png 778KB
samples_image_2
000000.png 832KB
000001.png 819KB
.gitignore 444B
images
feature_processing.jpg 209KB
feature_matching.jpg 183KB
result_1875.jpg 32KB
algo_over.png 93KB
match5.PNG 132KB
detector-masks.PNG 12KB
feature_bucketing.jpg 146KB
README.md 5KB
code
main.m 3KB
functions
updateMotion
updateMotionP3P.m 1KB
featureSelection
bucketFeatures.m 2KB
featureProcessing
computeFeatures.m 936B
nonMaximalSuppression
checkMinimumValidity.m 1KB
nonMaximumSuppression.m 5KB
checkMaximumValidity.m 1KB
filters
blob5x5.m 531B
checkerboard5x5.m 595B
sobel3x3.m 661B
sobel5x5.m 757B
descriptors
computeDescriptors.m 2KB
utils
showStereoMatches.m 2KB
showFeatures.m 952B
showFlowMatches.m 1KB
plotFeatures.m 894B
createCamProjectionMatrices.m 681B
triangulation
cross2Matrix.m 389B
linearTriangulation.m 925B
featureMatching
createIndexVector.m 1KB
findMatchSAD.m 3KB
matchFeaturePoints.m 2KB
performCircularMatching.m 4KB
verifyMatchNCC.m 1KB
removeOutliers.m 3KB
visualSOFT.m 3KB
config
configFile.m 3KB
共 42 条
- 1
资源评论
若明天不见
- 粉丝: 1w+
- 资源: 273
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功