ODM icon indicating copy to clipboard operation
ODM copied to clipboard

Order of cameras in image_list.txt and textured mesh quality improvement

Open v4ven27 opened this issue 10 years ago • 5 comments

Hello ODMers,

I was messing around with the odm_texturing module when I came across something bizarre.

I'm using 45 images for textured mesh generation. I noticed that the image_list.txt doesn't have any particular ordering for the cameras. Also, I am aware that the camera poses are represented in the bundler.out file in the same order as cameras in image_list.txt.

Upon importing the bundle.out and image_list.txt in the loadCameras method in OdmTexturing.cpp, we get the camera poses and corresponding texture filenames for each pcl::texture_mapping::Camera object which are then pushed onto cameras_ (which is a pcl::texture_mapping::CameraVector object).

I was curious about how changing the order of elements in cameras_ will affect texture mapping.

Here's an screenshot of the textured mesh generated by using the vector as is:

originalcameravector

Here's an screenshot of the textured mesh generated swapping the first four elements of cameras_ with the last four elements:

jumbledcameravector

Now, below is the screenshot of the textured mesh generated after sorting cameras_ using std::sort with a functor to compare the texture_file string of each camera object:

sortedcameravector

As can be seen, for the same set of inputs (and default arguments to run.sh), the textured mesh looks significantly different when I modify the order of the elements in the cameras_ vector. The sorted cameras_ vector (Figure 3) looks best.

You can find my modified OdmTexturing.cpp here. The key changes are in lines 432- 437, in the triangleToImageAssignment method.

I welcome any thoughts on the following:

  • Is this behavior expected?
  • On what basis does Bundler decide the camera order?

Thanks!

v4ven27 avatar Sep 07 '16 21:09 v4ven27

Here are my observations with the tests/test_data images provided with ODM:

With unsorted camera_: selection_002

I then ran the same set of images with sorted camera_: selection_001

It can be seen that the tree on the bottom left is more clear in the second image, and a parked car is visible under the tree.

v4ven27 avatar Sep 07 '16 22:09 v4ven27

@v4ven27 -- two (related) questions: which branch are you using that uses bundler? OpenSfM should be the SfM engine its using (although perhaps with bundler formats). Also, have you tried the dev branch? The texturing engine has been replaced and substantially improved using an existing library: https://www.youtube.com/embed/Ie-qLJdmlLI

smathermather avatar Sep 09 '16 13:09 smathermather

@smathermather I'm currently using the main branch which uses OpenSfM (which combines Bundler+PMVS). I'll checkout the dev branch.. thanks!

v4ven27 avatar Sep 09 '16 17:09 v4ven27

@v4ven27 if you see the same issue in the dev branch we welcome pull requests!

dakotabenjamin avatar Sep 12 '16 13:09 dakotabenjamin

This issue is outdated and will be closed. Please open a new thread in http://community.opendronemap.org and reference this issue if you would like to continue the conversation.

dakotabenjamin avatar Mar 28 '18 18:03 dakotabenjamin