Skip to content
Snippets Groups Projects
Commit 0d599e5c authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

FIX ANMS double stuff

parent 8e0cacd3
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ vector<cv::KeyPoint> Sdc(vector<cv::KeyPoint> keyPoints, int numRetPoints, float
vector<int> result; result.reserve(keyPoints.size());
while(!complete){
radius = low+(high-low)/2;
radius = low+(high-low)/2.0;
if (radius == prevradius || low>high) { //needed to reassure the same radius is not repeated again
ResultVec = result; //return the keypoints from the previous iteration
break;
......@@ -245,19 +245,22 @@ vector<int> Ssc(const vector<cv::KeyPoint>& keyPoints, const int& numRetPoints,
vector<int> result; result.reserve(keyPoints.size());
while(!complete){
width = low+(high-low)/2;
width = low+(high-low)/2.0;
if (width == prevWidth || low>high) { //needed to reassure the same radius is not repeated again
ResultVec = result; //return the keypoints from the previous iteration
break;
}
result.clear();
double c = width/2; //initializing Grid
double c = width/2.0; //initializing Grid
int numCellCols = floor(cols/c);
int numCellRows = floor(rows/c);
vector<vector<bool> > coveredVec(numCellRows+1,vector<bool>(numCellCols+1,false));
for (unsigned int i=0;i<keyPoints.size();++i){
int row = floor(keyPoints[i].pt.y/c); //get position of the cell current point is located at
int row = floor(keyPoints[i].pt.y/c); //get position of the cell current point is located at
int col = floor(keyPoints[i].pt.x/c);
if (coveredVec[row][col]==false){ // if the cell is not covered
result.push_back(i);
......
......@@ -3,7 +3,10 @@
#include <iostream>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include "../../vision_utils.h"
#include "nanoflann.hpp"
#include "range_tree_ranget.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment