//! Interpolate scale-space extrema to subpixel accuracy to form an image feature. void interpolateExtremum(int r, int c, ResponseLayer *t, ResponseLayer *m, ResponseLayer *b, FastHessian *fh) { double xi = 0, xr = 0, xc = 0; // get the step distance between filters // check the middle filter is mid way between top and bottom int filterStep = (m->filter - b->filter); assert(filterStep > 0 && t->filter - m->filter == m->filter - b->filter); // Get the offsets to the actual location of the extremum interpolateStep(r, c, t, m, b, &xi, &xr, &xc ); if( fabs( xi ) < 0.5f && fabs( xr ) < 0.5f && fabs( xc ) < 0.5f ) { Ipoint ipt; ipt.x = (float)((c + xc) * t->step); ipt.y = (float)((r + xr) * t->step); ipt.scale = (float)((0.1333f) * (m->filter + xi * filterStep)); ipt.laplacian = (int)(getLaplacian(r,c,t,m)); fh->ipts[count] = ipt; count++; } }
//! Interpolate scale-space extrema to subpixel accuracy to form an image feature. void FastHessian::interpolateExtremum(int r, int c, ResponseLayer *t, ResponseLayer *m, ResponseLayer *b) { // get the step distance between filters // check the middle filter is mid way between top and bottom int filterStep = (m->filter - b->filter); assert(filterStep > 0 && t->filter - m->filter == m->filter - b->filter); // Get the offsets to the actual location of the extremum double xi = 0, xr = 0, xc = 0; interpolateStep(r, c, t, m, b, &xi, &xr, &xc ); // If point is sufficiently close to the actual extremum if( fabs( xi ) < 0.5f && fabs( xr ) < 0.5f && fabs( xc ) < 0.5f ) { sim::alg::SurfLandmark ipt; ipt.x = static_cast<float>((c + xc) * t->step); ipt.y = static_cast<float>((r + xr) * t->step); ipt.scale = static_cast<float>((0.1333f) * (m->filter + xi * filterStep)); ipt.laplacian_sign = static_cast<int>(m->getLaplacian(r,c,t)); ipts.push_back(ipt); } }