Skip to content

Commit

Permalink
Merge pull request #40 from alicevision/mug/cameraCleanup
Browse files Browse the repository at this point in the history
Update following changes in aliceVision_camera
  • Loading branch information
cbentejac authored Aug 25, 2023
2 parents c4c2a8a + 9b7a8f0 commit 914af9a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/qtAliceVision/FloatImageViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ QSGNode* FloatImageViewer::updatePaintNode(QSGNode* oldNode, QQuickItem::UpdateP
newTextureSize = texture->textureSize();

// Crop the image to only display what is inside the fisheye circle
const aliceVision::camera::EquiDistant* intrinsicEquiDistant = _surface.getIntrinsicEquiDistant();
if (_cropFisheye && intrinsicEquiDistant)
const aliceVision::camera::Equidistant* intrinsicEquidistant = _surface.getIntrinsicEquidistant();
if (_cropFisheye && intrinsicEquidistant)
{
const aliceVision::Vec3 fisheyeCircleParams(intrinsicEquiDistant->getCircleCenterX(),
intrinsicEquiDistant->getCircleCenterY(),
intrinsicEquiDistant->getCircleRadius());
const aliceVision::Vec3 fisheyeCircleParams(intrinsicEquidistant->getCircleCenterX(),
intrinsicEquidistant->getCircleCenterY(),
intrinsicEquidistant->getCircleRadius());

const double width = _image->Width() * pow(2.0, _downscaleLevel);
const double height = _image->Height() * pow(2.0, _downscaleLevel);
Expand Down
12 changes: 6 additions & 6 deletions src/qtAliceVision/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void Surface::computeVerticesGrid(QSGGeometry::TexturedPoint2D* vertices, QSize
pose = _msfmData->rawData().getPose(view);
}

aliceVision::camera::EquiDistant* eqcam = dynamic_cast<aliceVision::camera::EquiDistant*>(intrinsic);
aliceVision::camera::Equidistant* eqcam = dynamic_cast<aliceVision::camera::Equidistant*>(intrinsic);
aliceVision::Vec2 center = {0, 0};
double radius = std::numeric_limits<double>::max();

Expand Down Expand Up @@ -402,7 +402,7 @@ QPointF Surface::getPrincipalPoint()

if (intrinsic && aliceVision::camera::isPinhole(intrinsic->getType()))
{
ppCorrection = dynamic_cast<aliceVision::camera::IntrinsicsScaleOffset&>(*intrinsic).getOffset();
ppCorrection = dynamic_cast<aliceVision::camera::IntrinsicScaleOffset&>(*intrinsic).getOffset();
}

return {ppCorrection.x(), ppCorrection.y()};
Expand Down Expand Up @@ -665,7 +665,7 @@ aliceVision::camera::IntrinsicBase* Surface::getIntrinsicFromViewId(unsigned int
return intrinsic;
}

const aliceVision::camera::EquiDistant* Surface::getIntrinsicEquiDistant() const
const aliceVision::camera::Equidistant* Surface::getIntrinsicEquidistant() const
{
const aliceVision::camera::IntrinsicBase* intrinsic = getIntrinsicFromViewId(_idView);
if (!intrinsic)
Expand All @@ -674,10 +674,10 @@ const aliceVision::camera::EquiDistant* Surface::getIntrinsicEquiDistant() const
}

// Load equidistant intrinsic (the intrinsic for full circle fisheye cameras)
const aliceVision::camera::EquiDistant* intrinsicEquiDistant =
dynamic_cast<const aliceVision::camera::EquiDistant*>(intrinsic);
const aliceVision::camera::Equidistant* intrinsicEquidistant =
dynamic_cast<const aliceVision::camera::Equidistant*>(intrinsic);

return intrinsicEquiDistant;
return intrinsicEquidistant;
}

} // namespace qtAliceVision
2 changes: 1 addition & 1 deletion src/qtAliceVision/Surface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Surface : public QObject
Q_EMIT verticesChanged();
}

const aliceVision::camera::EquiDistant* getIntrinsicEquiDistant() const;
const aliceVision::camera::Equidistant* getIntrinsicEquidistant() const;

private:
aliceVision::camera::IntrinsicBase* getIntrinsicFromViewId(unsigned int viewId) const;
Expand Down

0 comments on commit 914af9a

Please sign in to comment.