Order of cameras in image_list.txt and textured mesh quality improvement
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:

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

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:

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!
Here are my observations with the tests/test_data images provided with ODM:
With unsorted camera_:

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

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 -- 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 I'm currently using the main branch which uses OpenSfM (which combines Bundler+PMVS). I'll checkout the dev branch.. thanks!
@v4ven27 if you see the same issue in the dev branch we welcome pull requests!
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.