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

HyperSFM #1038

Open
wants to merge 64 commits into
base: develop
Choose a base branch
from

Conversation

sebastienchappuis
Copy link
Contributor

Here is the PR for adding hyperSFM to openMVG, as discussed in the following issue :

#1015

@pmoulon
Copy link
Member

pmoulon commented Aug 25, 2017

Seems like Clang raised some interesting warning:
warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
https://travis-ci.org/openMVG/openMVG/jobs/268370170#L2121

Then we have a test failure:
Test #70: openMVG_test_scene_aligner ...............................***Exception: SegFault
https://travis-ci.org/openMVG/openMVG/jobs/268370170#L2494

@sebastienchappuis
Copy link
Contributor Author

Yes that delete[] problem was also detected by codacy ! I corrected it.

As for that test failing I will have to get into it.

@sebastienchappuis
Copy link
Contributor Author

small recap of the situation that I posted on the issue :

#1015 (comment)

SubmapSfMReconstructionEngine to SequentialSfMReconstructionEngine to
work with codacy standards.
@@ -34,7 +34,8 @@ class SequentialSfMReconstructionEngine : public ReconstructionEngine
SequentialSfMReconstructionEngine(
const SfM_Data & sfm_data,
const std::string & soutDirectory,
const std::string & loggingFile = "");
const std::string & loggingFile = "",
const openMVG::tracks::STLMAPTracks & map_tracks = {});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this ok or should we make a whole new constructor for this ?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's dangerous since now we can set the tracks from outside. And so it means that we would like to change the SequentialSfMReconstructionEngine to check if tracks are present before to run the track computation...

@sebastienchappuis
Copy link
Contributor Author

Hello, it is now possible to optimize intrinsics during hypersfm. Each submap optimizes its intrinsics on its own, and the intrinsic that minimizes the error is chosen during merging. Outlier landmarks are also filtered out during merging now.

As you can see, the results are way better when intrinsics are taken into account (example on the Neuvick dataset):

with intrinsics optimization :
screenshot_20180614_113504

without:
without_intrinsics

@pmoulon
Copy link
Member

pmoulon commented Jun 14, 2018

Nice job @sebastienchappuis!
Any chance that one of your team will be at CVPR?

@@ -98,6 +108,8 @@ void generate_sfm_data_and_tracks(openMVG::sfm::SfM_Data & sfm_data, openMVG::tr
all_view_ids.insert(i);
}

sfm_data.intrinsics[0] = std::make_shared<openMVG::cameras::Pinhole_Intrinsic>();
Copy link
Member

Choose a reason for hiding this comment

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

Is is normal to have a default initialization?
I'm pretty sure you update it later on.

const auto intrinsicB = sfm_data_B.intrinsics.at(cam_id);

// quick escape in case intrinsics are equal
// TODO ? here we only check for pointer equality should we do more ?
Copy link
Member

Choose a reason for hiding this comment

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

Each intrinsic have a HASH build on the parameter.
So you can check that the camera type and the hash is the same:
getType && hashValue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes that's what I wanted ! do I need to check for both though ? it looks like the type information is contained in the hash ?

return std::unique_ptr<SubmapThresholdChecker>(new SubmapViewThresholdChecker(view_threshold));
}
else
{
std::cout << "Tracks threshold chosen: " << tracks_threshold << std::endl;
std::cout << "Tracks threshold chosen : " << tracks_threshold << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

it was right. English,UK, USA, syntax is without space ;-)

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.

None yet

3 participants