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

Optical center relative to the image center #1072

Merged
merged 14 commits into from
Aug 19, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jul 8, 2021

replace principal point with offset from image center in camera internal description

@ghost ghost requested a review from fabiencastan July 8, 2021 08:44
@fabiencastan fabiencastan changed the title Dev/offset from center Optical center relative to the image center Jul 23, 2021
Copy link
Member

@fabiencastan fabiencastan left a comment

Choose a reason for hiding this comment

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

Need to add a compatibility code in IO files.

@ghost ghost force-pushed the dev/offsetFromCenter branch 2 times, most recently from f346c9d to 7cf9b06 Compare August 13, 2021 07:35
Comment on lines 26 to 42
inline bool isVersionOlder(const Vec3 & version, const Vec3 & base)
{
for (Vec3::Index i = 0; i < 3; i++)
{
if (version[i] < base[i])
{
return true;
}

if (version[i] > base[i])
{
return false;
}
}

return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

class Version
{
public:
Version(const Vec3&);
Version(int major, int minor, int micro);
bool operator<(const Vec3& other) const;
private:
Vec3 _v;
};

src/aliceVision/sfm/BundleAdjustmentCeres.cpp Outdated Show resolved Hide resolved
src/aliceVision/sfm/BundleAdjustmentPanoramaCeres.cpp Outdated Show resolved Hide resolved
Comment on lines +32 to +33
const double ppx = 2020.0 - (double(w) / 2.0);
const double ppy = 1040.0 - (double(h) / 2.0);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const double ppx = 2020.0 - (double(w) / 2.0);
const double ppy = 1040.0 - (double(h) / 2.0);
const double ppx = -26;
const double ppy = 16;

src/aliceVision/sfmDataIO/viewIO.cpp Show resolved Hide resolved
}

private:
Vec3 _v;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Vec3 _v;
Vec3i _v;

Copy link
Author

Choose a reason for hiding this comment

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

It's obvious that integers are better suited for this task.
However, i choose doubles as Json I/O has always loaded/saved doubles.

@fabiencastan fabiencastan force-pushed the dev/offsetFromCenter branch 4 times, most recently from 46086cd to 4b2d4cc Compare August 18, 2021 15:58
@fabiencastan fabiencastan merged commit ff06f5f into develop Aug 19, 2021
@fabiencastan fabiencastan deleted the dev/offsetFromCenter branch August 19, 2021 08:22
@fabiencastan fabiencastan added this to the 2.5.0 milestone Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants