Skip to content

Commit

Permalink
Parameterize test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 17, 2024
1 parent d3d5b46 commit e9bcaaf
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import java.io.IOException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.cartesian.CartesianTest;
import org.junitpioneer.jupiter.cartesian.CartesianTest.Enum;
import org.opencv.calib3d.Calib3d;
import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
Expand Down Expand Up @@ -35,15 +36,15 @@ public static void init() throws IOException {
ConfigManager.getInstance().load();
}

@Test
public void testUndistortImagePointsWithRotation() {
@CartesianTest
public void testUndistortImagePointsWithRotation(@Enum ImageRotationMode rot) {
// Use predefined camera calibration coefficients from TestUtils
CameraCalibrationCoefficients coeffs = TestUtils.get2023LifeCamCoeffs(true);

FrameStaticProperties frameProps =
new FrameStaticProperties(
(int) coeffs.unrotatedImageSize.width, (int) coeffs.unrotatedImageSize.height, -1, coeffs);
FrameStaticProperties rotatedFrameProps = frameProps.rotate(ImageRotationMode.DEG_90_CCW);
FrameStaticProperties rotatedFrameProps = frameProps.rotate(rot);
CameraCalibrationCoefficients rotatedCoeffs = rotatedFrameProps.cameraCalibration;

Point[] originalPoints = {new Point(100, 100), new Point(200, 200)};
Expand Down

0 comments on commit e9bcaaf

Please sign in to comment.