// Find the image features and write into vector of features std::vector<IPoint> * FastHessian::getIpoints() { // filter index map int filter_map[5][4] = {{0,1,2,3}, {1,3,4,5}, {3,5,6,7}, {5,7,8,9}, {7,9,10,11}}; // Clear the vector of exisiting ipts if (ipts == NULL) ipts = new std::vector<IPoint>(); else ipts->clear(); // Build the response map buildResponseMap(); // Get the response layers ResponseLayer * b, * m, * t; for (int o = 0; o < octaves; ++o) for (int i = 0; i <= 1; ++i) { b = (*responseMap)[filter_map[o][i]]; m = (*responseMap)[filter_map[o][i+1]]; t = (*responseMap)[filter_map[o][i+2]]; // loop over middle response layer at density of the most // sparse layer (always top), to find maxima across scale and space for (int r = 0; r < t->height; ++r) { for (int c = 0; c < t->width; ++c) { if (isExtremum(r, c, *t, *m, *b)) { interpolateExtremum(r, c, *t, *m, *b); } } } } return ipts; }
//! Find the image features and write into vector of features void FastHessian::findFeatures() { // filter index map static const int filter_map [OCTAVES][INTERVALS] = {{0,1,2,3}, {1,3,4,5}, {3,5,6,7}, {5,7,8,9}, {7,9,10,11}}; // Clear the vector of exisiting ipts ipts.clear(); // Build the response map buildResponseMap(); // Get the response layers ResponseLayer *b, *m, *t; for (int o = 0; o < octaves; ++o) for (int i = 0; i <= 1; ++i) { b = responseMap.at(filter_map[o][i]); m = responseMap.at(filter_map[o][i+1]); t = responseMap.at(filter_map[o][i+2]); // loop over middle response layer at density of the most // sparse layer (always top), to find maxima across scale and space for (int r = 0; r < t->height; ++r) { for (int c = 0; c < t->width; ++c) { if (isExtremum(r, c, t, m, b)) { interpolateExtremum(r, c, t, m, b); } } } } }
int getIpoints(FastHessian *fh) { int o,i,r,c; ResponseLayer *b, *m, *t; // filter index map // variables should be OCTAVES AND INTERVAL BUT THERE IS AN ERROR static const int filter_map [5][4] = {{0,1,2,3}, {1,3,4,5}, {3,5,6,7}, {5,7,8,9}, {7,9,10,11}}; // Build the response map buildResponseMap(fh); // Get the response layers // Get the response layers for (o = 0; o < fh->octaves; ++o) { for (i = 0; i <= 1; ++i) { b = &fh->responseMap[filter_map[o][i]]; m = &fh->responseMap[filter_map[o][i+1]]; t = &fh->responseMap[filter_map[o][i+2]]; // loop over middle response layer at density of the most // sparse layer (always top), to find maxima across scale and space for (r = 0; r < t->height; ++r) { for (c = 0; c < t->width; ++c) { if (isExtremum(r, c, t, m, b,fh)) { interpolateExtremum(r, c, t, m, b,fh); } } } } } return count; }