flanggut / smvs

Shading-aware Multi-view Stereo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Models are flipped over X axis

mordka opened this issue · comments

First of all, I would like to thank you for this amazing tool. I'm using drone videos for scene reconstruction and it works amazingly well. Extracted video framwes are fed to the MVE pipeline. Standard parameters are used to reconstruct the scene. Here is an example of meta.ini rotation parameter generated:
rotation = -0.9634011388 -0.2680799067 -0.001736412523 0.1153697371 -0.4203992188 0.900010407 -0.2420091629 0.8668632507 0.4359418452
Then smvsrecon is run on a prepared scene folder.
All goes fine, the resulting point cloud looks correct, however it's always rotated (for every different set of images, even for sample temple model) as on the screenshots. I'm not sure if this is wrong on SfM step or it's smvs recon not picking up camera orientation properly.
This causes problems in the next steps - mesh generation and texture appliance. The resulting models are black and rotated.
One possible workaround is to take ply file and rotate it programatically using meshlabserver filter.

image

Manually rotated 180 degrees over X axis and barycenter point - looks fine
image

Hi! I am not sure what you're referring to exactly. The global rotation of the scene is basically arbitrary as we cannot infer it only from the input images. This should however not have an effect on the overall pipeline.

If you just want to flip the mesh for the output you can add something like

#include "mve/mesh_tools.h"
...
        math::Matrix3f flip;
        flip.fill(0.f);
        flip(0, 0) = 1.f;
        flip(1, 1) = -1.f;
        flip(2, 2) = -1.f;
        mve::geom::mesh_transform(mesh, flip);
...

to SMVS (for example here).

Thanks @flanggut , that change does the job, resulting ply file is flipped now. However it caused segfaults during next step - texturing using texrecon. So the best thing for me to do now, is to debug MVE orientation parameters.