コード例 #1
0
  /**
   * Creates a random image and looks for corners in it. Sees if the naive and fast algorithm
   * produce exactly the same results.
   */
  @Test
  public void compareToNaive() {
    GrayU8 img = new GrayU8(width, height);
    ImageMiscOps.fillUniform(img, new Random(0xfeed), 0, 100);

    GrayS16 derivX = new GrayS16(img.getWidth(), img.getHeight());
    GrayS16 derivY = new GrayS16(img.getWidth(), img.getHeight());

    GradientSobel.process(img, derivX, derivY, new ImageBorder1D_S32(BorderIndex1D_Extend.class));

    BoofTesting.checkSubImage(this, "compareToNaive", true, derivX, derivY);
  }
コード例 #2
0
  private void setTargetLocation(int x, int y) {
    ImageMiscOps.fillUniform(image, rand, 0, 1);
    ImageMiscOps.fillRectangle(image, 100, cornerX, cornerY, 20, 20);
    pyramid.process(image);

    for (int i = 0; i < pyramid.getNumLayers(); i++) {
      GradientSobel.process(
          pyramid.getLayer(i),
          derivX[i],
          derivY[i],
          new ImageBorder1D_F32(BorderIndex1D_Extend.class));
    }
  }