Example #1
0
  /**
   * Compute the descriptor with information on which level in the scale-space to use.
   *
   * @param c_x Location of feature in input image
   * @param c_y Location of feature in input image
   * @param scale Size of the feature in the input image
   * @param orientation Orientation of the feature
   * @param imageIndex Which octave contains the feature
   * @param pixelScale The scale of a pixel in the octave
   * @param desc (Output) storage for the descriptor
   */
  public void process(
      double c_x,
      double c_y,
      double scale,
      double orientation,
      int imageIndex,
      double pixelScale,
      SurfFeature desc) {
    image = ss.getPyramidLayer(imageIndex);
    derivX = ss.getDerivativeX(imageIndex);
    derivY = ss.getDerivativeY(imageIndex);

    for (int i = 0; i < desc.value.length; i++) desc.value[i] = 0;
    for (int i = 0; i < histograms.length; i++)
      for (int j = 0; j < histograms[i].length; j++) histograms[i][j] = 0;

    // account for the scale of the image in each octave
    constructHistograms(c_x / pixelScale, c_y / pixelScale, scale / pixelScale, orientation);

    computeDescriptor(desc);
  }