Skip to content

Commit

Permalink
Add MJPEG variants for Linux testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Dec 13, 2024
1 parent 41bc8d4 commit 07277fe
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 16 additions & 10 deletions wpical/src/test/native/cpp/test_calibrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,36 @@
#include <wpi/json.h>

const std::string projectRootPath = PROJECT_ROOT_PATH;

#ifdef __linux__
const std::string fileSuffix = "_mjpeg.mp4";
#else
const std::string fileSuffix = ".mp4";
#endif
TEST(Camera_CalibrationTest, OpenCV_Typical) {
int ret = cameracalibration::calibrate(
projectRootPath + "/testcalibration.mp4", 0.709f, 0.551f, 12, 8, false);
projectRootPath + "/testcalibration" + fileSuffix, 0.709f, 0.551f, 12, 8,
false);
EXPECT_EQ(ret, 0);
}

TEST(Camera_CalibrationTest, OpenCV_Atypical) {
int ret = cameracalibration::calibrate(
projectRootPath + "/fieldvideo/long.mp4", 0.709f, 0.551f, 12, 8, false);
projectRootPath + "/fieldvideo/long" + fileSuffix, 0.709f, 0.551f, 12, 8,
false);
EXPECT_EQ(ret, 1);
}

TEST(Camera_CalibrationTest, MRcal_Typical) {
int ret =
cameracalibration::calibrate(projectRootPath + "/testcalibration.mp4",
0.709f, 12, 8, 1080, 1920, false);
int ret = cameracalibration::calibrate(
projectRootPath + "/testcalibration" + fileSuffix, 0.709f, 12, 8, 1080,
1920, false);
EXPECT_EQ(ret, 0);
}

TEST(Camera_CalibrationTest, MRcal_Atypical) {
int ret =
cameracalibration::calibrate(projectRootPath + "/fieldvideo/short.mp4",
0.709f, 12, 8, 1080, 1920, false);
int ret = cameracalibration::calibrate(
projectRootPath + "/fieldvideo/short" + fileSuffix, 0.709f, 12, 8, 1080,
1920, false);
EXPECT_EQ(ret, 1);
}

Expand All @@ -49,7 +55,7 @@ TEST(Field_CalibrationTest, Typical) {
TEST(Field_CalibrationTest, Atypical_Bad_Camera_Model_Directory) {
int ret = fieldcalibration::calibrate(
projectRootPath + "/fieldvideo", projectRootPath + "",
projectRootPath + "/fieldvideo/long.mp4",
projectRootPath + "/fieldvideo/long" + fileSuffix,
projectRootPath + "/2024-crescendo.json", 3, 15, false);
EXPECT_EQ(ret, 1);
}
Expand Down

0 comments on commit 07277fe

Please sign in to comment.