Partially implemented scanning test
This commit is contained in:
parent
5852418b0b
commit
595743bda2
@ -56,7 +56,7 @@ public class Homograph2 implements Homograph{
|
||||
@Override
|
||||
public void renormalize() {
|
||||
//After the points are merged, depending on the implementation of the merging algorithm, the points might need to be renormalized
|
||||
//This specific Algorithm does not need to be remerged
|
||||
//This specific Algorithm does not need to be renormalized
|
||||
//TODO double check that fact with a test
|
||||
|
||||
}
|
||||
|
@ -10,17 +10,20 @@ public class TwoSidedScanner extends SingleColorScanner {
|
||||
private SideScanner frontSideScanner;
|
||||
private SideScanner rightSideScanner;
|
||||
|
||||
BufferedImage frontSideImages[];
|
||||
BufferedImage rightSideImages[];
|
||||
|
||||
public TwoSidedScanner(BufferedImage frontSideImages[], BufferedImage rightSideImages[]) {
|
||||
|
||||
this.frontSideImages = frontSideImages;
|
||||
this.rightSideImages = rightSideImages;
|
||||
//TODO
|
||||
|
||||
frontSideScanner = new SingleColoredSideScanner(frontSideImages, this.gammaDelta, , , );
|
||||
rightSideScanner = new SingleColoredSideScanner(rightSideImages, this.gammaDelta, , , );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Homograph scan() {
|
||||
// TODO Auto-generated method stub
|
||||
frontSideScanner = new SingleColoredSideScanner(frontSideImages, this.gammaDelta, , , );
|
||||
rightSideScanner = new SingleColoredSideScanner(rightSideImages, this.gammaDelta, , , );
|
||||
|
||||
frontSideScanner.scan();
|
||||
frontSideScanner.normalizePoints();
|
||||
Point2D[] frontPoints = frontSideScanner.getPoints();
|
||||
|
@ -14,6 +14,10 @@ import javax.imageio.ImageIO;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.cringe_studios.christmastreescanning.Homograph;
|
||||
import com.cringe_studios.christmastreescanning.Point3D;
|
||||
import com.cringe_studios.christmastreescanning.Scanner;
|
||||
import com.cringe_studios.christmastreescanning.TwoSidedScanner;
|
||||
import com.cringe_studios.christmastreescanning.scanning.image_scanning.GrayscaleImageScanner;
|
||||
import com.cringe_studios.christmastreescanning.scanning.image_scanning.ImageScanner;
|
||||
|
||||
@ -23,6 +27,29 @@ public class ExampleTest {
|
||||
public void testSus() {
|
||||
assertEquals(1 + 1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void scannerTest() {
|
||||
try {
|
||||
BufferedImage LED1Front = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED1_front.png"));
|
||||
BufferedImage LED2Front = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED2_front.png"));
|
||||
BufferedImage LED3Front = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED3_front.png"));
|
||||
BufferedImage LED1Right = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED1_right.png"));
|
||||
BufferedImage LED2Right = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED2_right.png"));
|
||||
BufferedImage LED3Right = ImageIO.read(ExampleTest.class.getResourceAsStream("ScannerTest1_LED3_right.png"));
|
||||
|
||||
Scanner scanner = new TwoSidedScanner(new BufferedImage[] {LED1Front, LED2Front, LED3Front}, new BufferedImage[] {LED1Right, LED2Right, LED3Right});
|
||||
scanner.setGammaDelta((byte)(0.1 * 255));
|
||||
Homograph homo = scanner.scan();
|
||||
homo.merge();
|
||||
homo.renormalize();
|
||||
Point3D points[] = homo.getPoints();
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
|
BIN
src/test/resources/ScannerTest1_LED1_front.png
Normal file
BIN
src/test/resources/ScannerTest1_LED1_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
BIN
src/test/resources/ScannerTest1_LED1_right.png
Normal file
BIN
src/test/resources/ScannerTest1_LED1_right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 241 KiB |
BIN
src/test/resources/ScannerTest1_LED2_front.png
Normal file
BIN
src/test/resources/ScannerTest1_LED2_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 207 KiB |
BIN
src/test/resources/ScannerTest1_LED2_right.png
Normal file
BIN
src/test/resources/ScannerTest1_LED2_right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 235 KiB |
BIN
src/test/resources/ScannerTest1_LED3_front.png
Normal file
BIN
src/test/resources/ScannerTest1_LED3_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 231 KiB |
BIN
src/test/resources/ScannerTest1_LED3_right.png
Normal file
BIN
src/test/resources/ScannerTest1_LED3_right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 249 KiB |
Loading…
Reference in New Issue
Block a user