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

Update following changes in aliceVision_camera #40

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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