Loading src/main/java/object_detection/types/BoundingBox2D.java +22 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,28 @@ public class BoundingBox2D { && p.getY() <= (this.y + this.h); } /* ########## Getters ########## */ public String getPredClass() { return predClass; } public int getX() { return x; } public int getY() { return y; } public int getW() { return w; } public int getH() { return h; } // members int x; Loading src/main/java/object_detection/types/CameraPose.java +11 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,17 @@ public class CameraPose { return translation; } /* ########## Getters ########## */ public DMatrixRMaj getR() { return R; } public DMatrixRMaj getTranslation() { return translation; } /* ################## Members #################### */ Loading src/main/java/object_detection/types/Frame.java +15 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,21 @@ public class Frame { return res; } /* ########## Getters ########## */ public String getBboxPath() { return bboxpath; } public List<BoundingBox2D> getBoxes() { return boxes; } public CameraPose getCamera() { return camera; } /* ######################### Members ########################### */ Loading src/test/java/object_detection/FrameTests.java 0 → 100644 +38 −0 Original line number Diff line number Diff line package object_detection; import org.junit.jupiter.api.BeforeEach; import object_detection.types.*; import java.io.FileWriter; import java.io.IOException; import java.io.FileNotFoundException; class FrameTests { private CameraPose cameraPose; private Frame frame; @BeforeEach void setUp() throws IOException, FileNotFoundException { // Create a CameraPose for the frame String tempPoseFile = "test_pose.csv"; try (FileWriter writer = new FileWriter(tempPoseFile)) { writer.write("1.0,2.0,3.0\n"); // Translation vector writer.write("1.0,0.0,0.0\n"); // R matrix rows writer.write("0.0,1.0,0.0\n"); writer.write("0.0,0.0,1.0\n"); } cameraPose = new CameraPose(tempPoseFile); // Create a temporary bbox file for the frame String tempBboxFile = "test_bbox.csv"; try (FileWriter writer = new FileWriter(tempBboxFile)) { writer.write("Class,x,y,w,h\n"); // Header writer.write("vehicle,10,10,20,20\n"); writer.write("animal,50,50,30,30\n"); } // Initialize the Frame object frame = new Frame(tempBboxFile, cameraPose); } } target/classes/.DS_Storedeleted 100644 → 0 −10 KiB File deleted. View file Loading
src/main/java/object_detection/types/BoundingBox2D.java +22 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,28 @@ public class BoundingBox2D { && p.getY() <= (this.y + this.h); } /* ########## Getters ########## */ public String getPredClass() { return predClass; } public int getX() { return x; } public int getY() { return y; } public int getW() { return w; } public int getH() { return h; } // members int x; Loading
src/main/java/object_detection/types/CameraPose.java +11 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,17 @@ public class CameraPose { return translation; } /* ########## Getters ########## */ public DMatrixRMaj getR() { return R; } public DMatrixRMaj getTranslation() { return translation; } /* ################## Members #################### */ Loading
src/main/java/object_detection/types/Frame.java +15 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,21 @@ public class Frame { return res; } /* ########## Getters ########## */ public String getBboxPath() { return bboxpath; } public List<BoundingBox2D> getBoxes() { return boxes; } public CameraPose getCamera() { return camera; } /* ######################### Members ########################### */ Loading
src/test/java/object_detection/FrameTests.java 0 → 100644 +38 −0 Original line number Diff line number Diff line package object_detection; import org.junit.jupiter.api.BeforeEach; import object_detection.types.*; import java.io.FileWriter; import java.io.IOException; import java.io.FileNotFoundException; class FrameTests { private CameraPose cameraPose; private Frame frame; @BeforeEach void setUp() throws IOException, FileNotFoundException { // Create a CameraPose for the frame String tempPoseFile = "test_pose.csv"; try (FileWriter writer = new FileWriter(tempPoseFile)) { writer.write("1.0,2.0,3.0\n"); // Translation vector writer.write("1.0,0.0,0.0\n"); // R matrix rows writer.write("0.0,1.0,0.0\n"); writer.write("0.0,0.0,1.0\n"); } cameraPose = new CameraPose(tempPoseFile); // Create a temporary bbox file for the frame String tempBboxFile = "test_bbox.csv"; try (FileWriter writer = new FileWriter(tempBboxFile)) { writer.write("Class,x,y,w,h\n"); // Header writer.write("vehicle,10,10,20,20\n"); writer.write("animal,50,50,30,30\n"); } // Initialize the Frame object frame = new Frame(tempBboxFile, cameraPose); } }