Added a new Test with computer generated images. Images in real life
still work better for some reason.
@ -195,6 +195,89 @@ public class ExampleTest {
|
||||
System.out.println("-----EndOf ScannerTest2");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void scannerTestComputerGeneratedTree() {
|
||||
System.out.println("ScannerTestComputerGeneratedTree:");
|
||||
try {
|
||||
BufferedImage southImages[] = new BufferedImage[20];
|
||||
BufferedImage eastImages[] = new BufferedImage[20];
|
||||
BufferedImage northImages[] = new BufferedImage[20];
|
||||
BufferedImage westImages[] = new BufferedImage[20];
|
||||
|
||||
for(int i = 1; i <= 20; i++) {
|
||||
southImages[i - 1] = ImageIO.read(ExampleTest.class.getResourceAsStream("/ComputerTree/Weihnachtsbaum/Süd00" + ((i < 10) ? "0" : "") + Integer.toString(i) + ".jpg"));
|
||||
eastImages[i - 1] = ImageIO.read(ExampleTest.class.getResourceAsStream("/ComputerTree/Weihnachtsbaum/Ost00" + ((i < 10) ? "0" : "") + Integer.toString(i) + ".jpg"));
|
||||
northImages[i - 1] = ImageIO.read(ExampleTest.class.getResourceAsStream("/ComputerTree/Weihnachtsbaum/Nord00" + ((i < 10) ? "0" : "") + Integer.toString(i) + ".jpg"));
|
||||
westImages[i - 1] = ImageIO.read(ExampleTest.class.getResourceAsStream("/ComputerTree/Weihnachtsbaum/West00" + ((i < 10) ? "0" : "") + Integer.toString(i) + ".jpg"));
|
||||
}
|
||||
|
||||
Scanner scanner = new FourSidedScanner(southImages, eastImages, northImages, westImages);
|
||||
scanner.setGammaDelta((byte)(0.1 * 255));
|
||||
Homograph homo = scanner.scan();
|
||||
homo.merge();
|
||||
homo.renormalize();
|
||||
Point3D points[] = homo.getPoints();
|
||||
|
||||
System.out.println(Arrays.toString(points));
|
||||
|
||||
boolean foundXMin = false; // -1
|
||||
boolean foundXMax = false; // 1
|
||||
boolean foundYMin = false; // -1
|
||||
boolean foundYMax = false; // 1
|
||||
boolean foundZMin = false; // 0
|
||||
boolean foundZMax = false; // 1
|
||||
|
||||
for(int i = 0; i < points.length; i++) {
|
||||
if(Math.abs(points[i].x - (-1.0)) < 0.001) {
|
||||
foundXMin = true;
|
||||
}
|
||||
|
||||
if(Math.abs(points[i].x - (1.0)) < 0.001) {
|
||||
foundXMax = true;
|
||||
}
|
||||
|
||||
if(Math.abs(points[i].y - (-1.0)) < 0.001) {
|
||||
foundYMin = true;
|
||||
}
|
||||
|
||||
if(Math.abs(points[i].y - (1.0)) < 0.001) {
|
||||
foundYMax = true;
|
||||
}
|
||||
|
||||
/*if(Math.abs(points[i].z - (1.0)) < 0.001) {
|
||||
foundZMax = true;
|
||||
}*/
|
||||
|
||||
if(Math.abs(points[i].z - (0.0)) < 0.001) {
|
||||
foundZMin = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(foundXMin && foundXMax && foundYMin && foundYMax /*&& foundZMin*/ /*&& foundZMax*/) {
|
||||
assertTrue(true);
|
||||
}else {
|
||||
System.out.println(foundXMin );
|
||||
System.out.println(foundXMax );
|
||||
System.out.println(foundYMin );
|
||||
System.out.println(foundYMax );
|
||||
System.out.println(foundZMin );
|
||||
System.out.println(foundZMax );
|
||||
|
||||
assertTrue(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("-----EndOf ScannerTestComputerGeneratedTree");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
|
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0001.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0002.jpg
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0003.jpg
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0004.jpg
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0005.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0006.jpg
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0007.jpg
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0008.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0009.jpg
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0010.jpg
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0011.jpg
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0012.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0013.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0014.jpg
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0015.jpg
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0016.jpg
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0017.jpg
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0018.jpg
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0019.jpg
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Nord0020.jpg
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0001.jpg
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0002.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0003.jpg
Normal file
After Width: | Height: | Size: 492 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0004.jpg
Normal file
After Width: | Height: | Size: 491 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0005.jpg
Normal file
After Width: | Height: | Size: 486 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0006.jpg
Normal file
After Width: | Height: | Size: 487 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0007.jpg
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0008.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0009.jpg
Normal file
After Width: | Height: | Size: 490 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0010.jpg
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0011.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0012.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0013.jpg
Normal file
After Width: | Height: | Size: 490 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0014.jpg
Normal file
After Width: | Height: | Size: 487 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0015.jpg
Normal file
After Width: | Height: | Size: 487 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0016.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0017.jpg
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0018.jpg
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0019.jpg
Normal file
After Width: | Height: | Size: 491 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Ost0020.jpg
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0001.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0002.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0003.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0004.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0005.jpg
Normal file
After Width: | Height: | Size: 524 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0006.jpg
Normal file
After Width: | Height: | Size: 524 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0007.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0008.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0009.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0010.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0011.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0012.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0013.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0014.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0015.jpg
Normal file
After Width: | Height: | Size: 524 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0016.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0017.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0018.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0019.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/Süd0020.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0001.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0002.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0003.jpg
Normal file
After Width: | Height: | Size: 531 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0004.jpg
Normal file
After Width: | Height: | Size: 529 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0005.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0006.jpg
Normal file
After Width: | Height: | Size: 529 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0007.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0008.jpg
Normal file
After Width: | Height: | Size: 529 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0009.jpg
Normal file
After Width: | Height: | Size: 533 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0010.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0011.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0012.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0013.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0014.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0015.jpg
Normal file
After Width: | Height: | Size: 531 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0016.jpg
Normal file
After Width: | Height: | Size: 526 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0017.jpg
Normal file
After Width: | Height: | Size: 528 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0018.jpg
Normal file
After Width: | Height: | Size: 531 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0019.jpg
Normal file
After Width: | Height: | Size: 530 KiB |
BIN
src/test/resources/ComputerTree/Weihnachtsbaum/West0020.jpg
Normal file
After Width: | Height: | Size: 531 KiB |