コード例 #1
0
  /** See if accessing the image edge causes it to blow up. */
  @Test
  public void get_edges() {
    T img = createImage(width, height);
    GImageMiscOps.fillUniform(img, rand, 0, 100);

    BoofTesting.checkSubImage(this, "get_edges", false, img);
  }
コード例 #2
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);
  }
コード例 #3
0
 @Test
 public void border() {
   BoofTesting.checkSubImage(this, "checkBorder", false, img, 0, 0, 5, 7);
   BoofTesting.checkSubImage(this, "checkBorder", false, img, img.width - 1, img.height - 1, 5, 7);
   BoofTesting.checkSubImage(this, "checkBorder", false, img, 100, 200, 5, 7);
 }
コード例 #4
0
 @Test
 public void inner() {
   BoofTesting.checkSubImage(this, "checkInner", false, img, 4, 6, 7, 5);
   BoofTesting.checkSubImage(this, "checkInner", false, img, 7, 3, 4, 5);
   BoofTesting.checkSubImage(this, "checkInner", false, img, 4, 6, 2, 4);
 }