Commit aea6cb5f authored by Sanford Jonathan Edelist's avatar Sanford Jonathan Edelist Committed by Rohan Kumar
Browse files

updated testing

parent bf2e89bd
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -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;
+11 −0
Original line number Diff line number Diff line
@@ -50,6 +50,17 @@ public class CameraPose {
        return translation;
    }

    /* ##########
        Getters
    ########## */
    public DMatrixRMaj getR() {
        return R;
    }

    public DMatrixRMaj getTranslation() {
        return translation;
    }

    /* ##################
        Members
    #################### */
+15 −0
Original line number Diff line number Diff line
@@ -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
    ########################### */
+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_Store

deleted100644 → 0
−10 KiB

File deleted.

Loading