globalKeypoints = new ArrayList<KeyPoint>();
// Generate keypoints from each scalespace.
for (int on = 0; on < pyr.count(); ++on) {
DScaleSpace dsp = pyr.octaves.get(on);
ArrayList<ScalePoint> peaks = dsp.findPeaks(dogThresh);// 寻找图片中的极值点
int oldCount = peaks.size();
ArrayList<ScalePoint> peaksFilt = dsp.filterAndLocalizePeaks(peaks, maximumEdgeRatio, dValueLowThresh,
scaleAdjustThresh, relocationMaximum);
if (verbose) {
System.out.printf (" filtered: %d remaining from %d, thats %5.2f %%\r\n",
peaksFilt.size(), oldCount, (100.0 * peaksFilt.size()) / oldCount);
System.out.println ("generating keypoints from peaks");
}
// Generate the actual keypoint descriptors, using pre-computed
// values for the gradient magnitude and direction.
dsp.generateMagnitudeAndDirectionMaps();
ArrayList<KeyPoint> keypoints = dsp.generateKeyPoints(peaksFilt, scaleSpaceLevels, octaveSigma);
dsp.clearMagnitudeAndDirectionMaps();
globalKeypoints.addAll(keypoints);
}
return (globalKeypoints.size());