-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Tbmr features (purely topological adaptation on MSER) #2713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
44c359d
initial commit
a2ee31b
fix test data reusing stereomatching testdata.
dfc9cf9
fix incorrect function, ellipse notation, types and comments.
f34c6a6
add required precomp.hpp, fix warnings.
4f2191c
fix naming
c396037
remove ocl for now. (we want to add opencl functionality later)
810eecb
update readme
4bfebc5
fix invalid module dependency.
70df975
add angle, minAxis and majAxis calculation.
592dd32
formatting fixes.
fb73bcc
fix test using virtual data.
3c59b3c
move tbmr to xfeatures2d. Add standard tests in xFeatures2d.
2eaff86
octave/scale and descriptor extraction using sift added
3223f46
try fix the errors
64537c6
fix parameter error
187d8cb
add scale for pyramid extraction and filter scaled points for duplica…
cd2909a
fix exports
7b71411
remove unrelated changes due to indentation
0c96156
remove unrelated indentation changes in tests
117abe4
externalize msd_pyramid
0245d3a
exchange malloc/calloc with AutoBuffer
ef488ea
fix warning
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// This file is part of OpenCV project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at http://opencv.org/license.html. | ||
|
||
#ifndef __OPENCV_XFEATURES2D_MSD_PYRAMID_HPP__ | ||
#define __OPENCV_XFEATURES2D_MSD_PYRAMID_HPP__ | ||
|
||
#include "precomp.hpp" | ||
|
||
namespace cv | ||
{ | ||
namespace xfeatures2d | ||
{ | ||
/*! | ||
MSD Image Pyramid. | ||
*/ | ||
class MSDImagePyramid | ||
{ | ||
// Multi-threaded construction of the scale-space pyramid | ||
struct MSDImagePyramidBuilder : ParallelLoopBody | ||
{ | ||
|
||
MSDImagePyramidBuilder(const cv::Mat& _im, std::vector<cv::Mat>* _m_imPyr, float _scaleFactor) | ||
{ | ||
im = &_im; | ||
m_imPyr = _m_imPyr; | ||
scaleFactor = _scaleFactor; | ||
|
||
} | ||
|
||
void operator()(const Range& range) const CV_OVERRIDE | ||
{ | ||
for (int lvl = range.start; lvl < range.end; lvl++) | ||
{ | ||
float scale = 1 / std::pow(scaleFactor, (float) lvl); | ||
(*m_imPyr)[lvl] = cv::Mat(cv::Size(cvRound(im->cols * scale), cvRound(im->rows * scale)), im->type()); | ||
cv::resize(*im, (*m_imPyr)[lvl], cv::Size((*m_imPyr)[lvl].cols, (*m_imPyr)[lvl].rows), 0.0, 0.0, cv::INTER_AREA); | ||
} | ||
} | ||
const cv::Mat* im; | ||
std::vector<cv::Mat>* m_imPyr; | ||
float scaleFactor; | ||
}; | ||
|
||
public: | ||
|
||
MSDImagePyramid(const cv::Mat &im, const int nLevels, const float scaleFactor = 1.6f) | ||
{ | ||
m_nLevels = nLevels; | ||
m_scaleFactor = scaleFactor; | ||
m_imPyr.clear(); | ||
m_imPyr.resize(nLevels); | ||
|
||
m_imPyr[0] = im.clone(); | ||
|
||
if (m_nLevels > 1) | ||
{ | ||
parallel_for_(Range(1, nLevels), MSDImagePyramidBuilder(im, &m_imPyr, scaleFactor)); | ||
} | ||
} | ||
~MSDImagePyramid() {}; | ||
|
||
const std::vector<cv::Mat> getImPyr() const | ||
{ | ||
return m_imPyr; | ||
}; | ||
|
||
private: | ||
|
||
std::vector<cv::Mat> m_imPyr; | ||
int m_nLevels; | ||
float m_scaleFactor; | ||
}; | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.