Ejemplo n.º 1
0
  /**
   * Processes the image and extracts SIFT features
   *
   * @param input input image
   */
  public void process(ImageFloat32 input) {

    features.reset();
    featureScales.reset();
    featureAngles.reset();
    location.reset();

    ss.constructPyramid(input);
    ss.computeFeatureIntensity();
    ss.computeDerivatives();

    detector.process(ss);
    orientation.setScaleSpace(ss);
    describe.setScaleSpace(ss);

    FastQueue<ScalePoint> found = detector.getFoundPoints();

    for (int i = 0; i < found.size; i++) {
      ScalePoint sp = found.data[i];
      orientation.process(sp.x, sp.y, sp.scale);

      GrowQueue_F64 angles = orientation.getOrientations();

      int imageIndex = orientation.getImageIndex();
      double pixelScale = orientation.getPixelScale();

      for (int j = 0; j < angles.size; j++) {
        SurfFeature desc = features.grow();

        double yaw = angles.data[j];

        describe.process(sp.x, sp.y, sp.scale, yaw, imageIndex, pixelScale, desc);

        desc.laplacianPositive = sp.white;
        featureScales.push(sp.scale);
        featureAngles.push(yaw);
        location.grow().set(sp.x, sp.y);
      }
    }
  }