mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
Removed Feature_Suppression_Distance function that is not used anywhere.
This commit is contained in:
parent
ab1ef08f0e
commit
3e51da38fb
@ -492,56 +492,6 @@ void AKAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts) {
|
|||||||
//timing_.subpixel = 1000.0*(t2 - t1) / cv::getTickFrequency();
|
//timing_.subpixel = 1000.0*(t2 - t1) / cv::getTickFrequency();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
/**
|
|
||||||
* @brief This method performs feature suppression based on 2D distance
|
|
||||||
* @param kpts Vector of keypoints
|
|
||||||
* @param mdist Maximum distance in pixels
|
|
||||||
*/
|
|
||||||
void AKAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts, float mdist) const {
|
|
||||||
|
|
||||||
vector<cv::KeyPoint> aux;
|
|
||||||
vector<size_t> to_delete;
|
|
||||||
float dist = 0.0, x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0;
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < kpts.size(); i++) {
|
|
||||||
x1 = kpts[i].pt.x;
|
|
||||||
y1 = kpts[i].pt.y;
|
|
||||||
for (size_t j = i + 1; j < kpts.size(); j++) {
|
|
||||||
x2 = kpts[j].pt.x;
|
|
||||||
y2 = kpts[j].pt.y;
|
|
||||||
dist = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
|
|
||||||
if (dist < mdist) {
|
|
||||||
if (fabs(kpts[i].response) >= fabs(kpts[j].response)) {
|
|
||||||
to_delete.push_back(j);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
to_delete.push_back(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < kpts.size(); i++) {
|
|
||||||
found = false;
|
|
||||||
for (size_t j = 0; j < to_delete.size(); j++) {
|
|
||||||
if (i == to_delete[j]) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (found == false) {
|
|
||||||
aux.push_back(kpts[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
kpts.clear();
|
|
||||||
kpts = aux;
|
|
||||||
aux.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
||||||
class SURF_Descriptor_Upright_64_Invoker : public cv::ParallelLoopBody
|
class SURF_Descriptor_Upright_64_Invoker : public cv::ParallelLoopBody
|
||||||
|
@ -46,7 +46,6 @@ public:
|
|||||||
void Compute_Multiscale_Derivatives(void);
|
void Compute_Multiscale_Derivatives(void);
|
||||||
void Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts);
|
void Find_Scale_Space_Extrema(std::vector<cv::KeyPoint>& kpts);
|
||||||
void Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts);
|
void Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts);
|
||||||
void Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts, float mdist) const;
|
|
||||||
|
|
||||||
// Feature description methods
|
// Feature description methods
|
||||||
void Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat& desc);
|
void Compute_Descriptors(std::vector<cv::KeyPoint>& kpts, cv::Mat& desc);
|
||||||
|
@ -590,62 +590,6 @@ void KAZEFeatures::Do_Subpixel_Refinement(std::vector<cv::KeyPoint> &kpts) {
|
|||||||
//*************************************************************************************
|
//*************************************************************************************
|
||||||
//*************************************************************************************
|
//*************************************************************************************
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This method performs feature suppression based on 2D distance
|
|
||||||
* @param kpts Vector of keypoints
|
|
||||||
* @param mdist Maximum distance in pixels
|
|
||||||
*/
|
|
||||||
void KAZEFeatures::Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts, const float& mdist) {
|
|
||||||
|
|
||||||
vector<KeyPoint> aux;
|
|
||||||
vector<size_t> to_delete;
|
|
||||||
float dist = 0.0, x1 = 0.0, y1 = 0.0, x2 = 0.0, y2 = 0.0;
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < kpts.size(); i++) {
|
|
||||||
x1 = kpts[i].pt.x;
|
|
||||||
y1 = kpts[i].pt.y;
|
|
||||||
|
|
||||||
for (size_t j = i + 1; j < kpts.size(); j++) {
|
|
||||||
x2 = kpts[j].pt.x;
|
|
||||||
y2 = kpts[j].pt.y;
|
|
||||||
dist = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
|
|
||||||
|
|
||||||
if (dist < mdist) {
|
|
||||||
if (fabs(kpts[i].response) >= fabs(kpts[j].response)) {
|
|
||||||
to_delete.push_back(j);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
to_delete.push_back(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < kpts.size(); i++) {
|
|
||||||
found = false;
|
|
||||||
|
|
||||||
for (size_t j = 0; j < to_delete.size(); j++) {
|
|
||||||
if (i == to_delete[j]) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found == false) {
|
|
||||||
aux.push_back(kpts[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
kpts.clear();
|
|
||||||
kpts = aux;
|
|
||||||
aux.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//*************************************************************************************
|
|
||||||
//*************************************************************************************
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This method computes the set of descriptors through the nonlinear scale space
|
* @brief This method computes the set of descriptors through the nonlinear scale space
|
||||||
* @param kpts Vector of keypoints
|
* @param kpts Vector of keypoints
|
||||||
|
@ -84,7 +84,6 @@ private:
|
|||||||
void Determinant_Hessian_Parallel(std::vector<cv::KeyPoint>& kpts);
|
void Determinant_Hessian_Parallel(std::vector<cv::KeyPoint>& kpts);
|
||||||
void Find_Extremum_Threading(const int& level);
|
void Find_Extremum_Threading(const int& level);
|
||||||
void Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts);
|
void Do_Subpixel_Refinement(std::vector<cv::KeyPoint>& kpts);
|
||||||
void Feature_Suppression_Distance(std::vector<cv::KeyPoint>& kpts, const float& mdist);
|
|
||||||
|
|
||||||
// AOS Methods
|
// AOS Methods
|
||||||
void AOS_Step_Scalar(cv::Mat &Ld, const cv::Mat &Ldprev, const cv::Mat &c, const float& stepsize);
|
void AOS_Step_Scalar(cv::Mat &Ld, const cv::Mat &Ldprev, const cv::Mat &c, const float& stepsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user