Skip to content

Conversation

@khshmt
Copy link
Contributor

@khshmt khshmt commented Jan 12, 2024

No description provided.

@pmoulon
Copy link
Member

pmoulon commented Jan 13, 2024

Thank you for your PR. I have also some work in progress that I did not pushed yet to log the growing sfm_data file as it is updated during the SFM process. I will merge both work.

How is your experience logging images. I got issue on dataset with hundred of images for out of memory.

Also it could be nice if you were willing to share some reconstruction you made and there rerun preview 😜

@khshmt
Copy link
Contributor Author

khshmt commented Jan 13, 2024

Hi Pierre thanks for your response,
I tried the example on two datasets one of them is yours "Sceaux castle" and the other dataset is for underwater coral reefs but both of them is about 10 images, so I faced no problem because of memory but I will explore bigger dataset soon.

this is a rerun preview for a reconstruction I made

Screenshot from 2024-01-13 12-35-47

@khshmt
Copy link
Contributor Author

khshmt commented Jan 15, 2024

Hi @pmoulon I hope you are doing well,
I updated merge with a second commit, I hope you try it on the dataset with hundreds of images you mentioned before Which caused out of memory issue

Copy link
Member

@pmoulon pmoulon left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor improvement that we can do:

  • use emplace_back to be less verbose
  • better use sfm_data.s_root_path to log the path to the image

std::unordered_map<uint32_t, std::vector<rerun::components::Position2D>>
points2d_per_img;
for (const auto& landmark : landmarks) {
points3d.push_back(rerun::components::Position3D(
Copy link
Member

Choose a reason for hiding this comment

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

Minor you can use emplace_back

points3d.emplace_back(
        landmark.second.X(0), landmark.second.X(1), landmark.second.X(2));

sfm_data.GetIntrinsics().at(id_intrinsic)->getParams()[0],
resolution));
openMVG::image::Image<openMVG::image::RGBColor> img;
auto is_img_loaded =
Copy link
Member

Choose a reason for hiding this comment

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

Right way to access the image path is to use the root path in SfM_data

      const std::string sImageName = stlplus::create_filespec(sfm_data.s_root_path, view->s_Img_path);
      auto is_img_loaded =
          openMVG::image::ReadImage(sImageName.c_str(), &img);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will work on these changes today.
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pmoulon requested changes finished.

@pmoulon
Copy link
Member

pmoulon commented Jan 23, 2024

Could be a limitation on my machine
image

Else loading without image is working:
image
image

@khshmt
Copy link
Contributor Author

khshmt commented Jan 23, 2024

I ran the example using about 140 images and worked well with the images, but I will double check.

…ordered_map::emplace_back instead of push_back
@pmoulon
Copy link
Member

pmoulon commented Jan 28, 2024

Waiting for CI and I will merge.
Thank you @khshmt for the contribution.
I will also push soon the integration I made to log as the SFM process is working, so you can have a real time preview of where the SFM process is

@pmoulon pmoulon merged commit 7fd19fc into openMVG:develop Jan 28, 2024
TongZhe2016 pushed a commit to TongZhe2016/openMVG that referenced this pull request Apr 24, 2025
…penMVG#2284)

* adding openMVG sample to visualize sfm_data using rerun sdk

* check if the view has observations before logging keyPoints to avoid std::out_of_range exception

* using sfm_data s_root_path instead of view s_img_path and use std::unordered_map::emplace_back instead of push_back
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.

2 participants