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

Debug in camera object #1461

Merged
merged 3 commits into from
Jun 9, 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
5 changes: 4 additions & 1 deletion src/aliceVision/camera/Equidistant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ namespace camera {
class EquiDistant : public IntrinsicsScaleOffsetDisto
{
public:
EquiDistant() = default;
EquiDistant() :
EquiDistant(1, 1, 1.0, 0.0, 0.0)
{
}

EquiDistant(unsigned int w, unsigned int h,
double focalLengthPix,
Expand Down
2 changes: 0 additions & 2 deletions src/aliceVision/camera/EquidistantRadial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace camera {
class EquiDistantRadialK3 : public EquiDistant
{
public:
EquiDistantRadialK3() = default;

explicit EquiDistantRadialK3(int w, int h,
double focalLengthPix,
double offsetX, double offsetY,
Expand Down
2 changes: 0 additions & 2 deletions src/aliceVision/camera/IntrinsicBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace camera {
class IntrinsicBase
{
public:
IntrinsicBase() = default;

explicit IntrinsicBase(unsigned int width, unsigned int height, const std::string& serialNumber = "") :
_w(width), _h(height), _serialNumber(serialNumber)
{
Expand Down
2 changes: 0 additions & 2 deletions src/aliceVision/camera/IntrinsicsScaleOffset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ namespace camera {
class IntrinsicsScaleOffset: public IntrinsicBase
{
public:
IntrinsicsScaleOffset() = default;

IntrinsicsScaleOffset(unsigned int w, unsigned int h,
double scaleX, double scaleY,
double offsetX, double offsetY) :
Expand Down
25 changes: 24 additions & 1 deletion src/aliceVision/camera/IntrinsicsScaleOffsetDisto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace camera {
class IntrinsicsScaleOffsetDisto : public IntrinsicsScaleOffset
{
public:
IntrinsicsScaleOffsetDisto() = default;

IntrinsicsScaleOffsetDisto(unsigned int w, unsigned int h,
double scaleX, double scaleY,
Expand All @@ -36,6 +35,30 @@ class IntrinsicsScaleOffsetDisto : public IntrinsicsScaleOffset
{
}

IntrinsicsScaleOffsetDisto(const IntrinsicsScaleOffsetDisto &other)
:
IntrinsicsScaleOffset(other),
_distortionInitializationMode(other._distortionInitializationMode)
{
if (other._pDistortion)
{
_pDistortion = std::shared_ptr<Distortion>(other._pDistortion->clone());
}
else
{
_pDistortion = nullptr;
}

if (other._pUndistortion)
{
_pUndistortion = std::shared_ptr<Undistortion>(other._pUndistortion->clone());
}
else
{
_pUndistortion = nullptr;
}
}

void assign(const IntrinsicBase& other) override
{
*this = dynamic_cast<const IntrinsicsScaleOffsetDisto&>(other);
Expand Down
5 changes: 4 additions & 1 deletion src/aliceVision/camera/Pinhole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ namespace camera {
class Pinhole : public IntrinsicsScaleOffsetDisto
{
public:
Pinhole() = default;
Pinhole() :
Pinhole(1, 1, 1.0, 1.0, 0.0, 0.0)
{
}

Pinhole(unsigned int w, unsigned int h, const Mat3& K) :
IntrinsicsScaleOffsetDisto(w, h, K(0, 0), K(1, 1), K(0, 2), K(1, 2))
Expand Down
4 changes: 3 additions & 1 deletion src/software/pipeline/main_panoramaInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ int main(int argc, char* argv[])
<< intrinsic->getTypeStr()
<< " to an EquiDistant camera model.");
// convert non-EquiDistant intrinsics to EquiDistant
std::shared_ptr<camera::EquiDistantRadialK3> newEquidistant(new camera::EquiDistantRadialK3());
std::shared_ptr<camera::EquiDistantRadialK3> newEquidistant =
std::dynamic_pointer_cast<camera::EquiDistantRadialK3>(
camera::createIntrinsic(camera::EINTRINSIC::EQUIDISTANT_CAMERA_RADIAL3));

newEquidistant->copyFrom(*intrinsicSO);
// "radius" and "center" will be set later from the input parameters in another loop
Expand Down