// consider is (3 * sigma) (until the weight becomes very small).
double sigma = 3.0 * kpScale;
int radius = (int) (3.0 * sigma / 2.0 + 0.5);
int radiusSq = radius * radius;
ImageMap magnitude = magnitudes[point.level];
ImageMap direction = directions[point.level];
// As the point may lie near the border, build the rectangle
// coordinates we can still reach, minus the border pixels, for which
// we do not have gradient information available.
int xMin = Math.max(point.x - radius, 1);