Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test camera model #95

Merged
merged 6 commits into from
Aug 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed 0.5 pixel offsets in tests
  • Loading branch information
AstroKEW78 committed Aug 22, 2018
commit 49862768217fa41a492061434dfad02b9020c168
12 changes: 6 additions & 6 deletions tests/FrameCameraTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class FrameSensorModel : public ::testing::Test {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can yank this comment, since this is fixed.

//centered and slightly off-center:
TEST_F(FrameSensorModel, Center) {
csm::ImageCoord imagePt(7.0, 7.0);
csm::ImageCoord imagePt(7.5, 7.5);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 10.0, 1e-8);
EXPECT_NEAR(groundPt.y, 0, 1e-8);
EXPECT_NEAR(groundPt.z, 0, 1e-8);
}
TEST_F(FrameSensorModel, SlightlyOffCenter) {
csm::ImageCoord imagePt(7.0, 6.0);
csm::ImageCoord imagePt(7.5, 6.5);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 9.80194018, 1e-8);
EXPECT_NEAR(groundPt.y, 0, 1e-8);
Expand All @@ -73,28 +73,28 @@ TEST_F(FrameSensorModel, SlightlyOffCenter) {

//Test all four corners:
TEST_F(FrameSensorModel, OffBody1) {
csm::ImageCoord imagePt(14.5, -0.5);
csm::ImageCoord imagePt(15.0, 0.0);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 0.44979759, 1e-8);
EXPECT_NEAR(groundPt.y, -14.99325304, 1e-8);
EXPECT_NEAR(groundPt.z, 14.99325304, 1e-8);
}
TEST_F(FrameSensorModel, OffBody2) {
csm::ImageCoord imagePt(-0.5, 14.5);
csm::ImageCoord imagePt(0.0, 15.0);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 0.44979759, 1e-8);
EXPECT_NEAR(groundPt.y, 14.99325304, 1e-8);
EXPECT_NEAR(groundPt.z, -14.99325304, 1e-8);
}
TEST_F(FrameSensorModel, OffBody3) {
csm::ImageCoord imagePt(-0.5, -0.5);
csm::ImageCoord imagePt(0.0, 0.0);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 0.44979759, 1e-8);
EXPECT_NEAR(groundPt.y, 14.99325304, 1e-8);
EXPECT_NEAR(groundPt.z, 14.99325304, 1e-8);
}
TEST_F(FrameSensorModel, OffBody4) {
csm::ImageCoord imagePt(14.5, 14.5);
csm::ImageCoord imagePt(15.0, 15.0);
csm::EcefCoord groundPt = sensorModel->imageToGround(imagePt, 0.0);
EXPECT_NEAR(groundPt.x, 0.44979759, 1e-8);
EXPECT_NEAR(groundPt.y, -14.99325304, 1e-8);
Expand Down