SBCV / Blender-Addon-Photogrammetry-Importer

Addon to import different photogrammetry formats into Blender
MIT License
868 stars 76 forks source link

Meshroom reconstructed cameras FOV and Shift X / Y issues #73

Open catalinad opened 5 months ago

catalinad commented 5 months ago

Hi!

Thank you for this awesome addon! I used Meshroom to create a 3D Model from a set of photos. I need to render the 3D Model from specific views into files (my plan is to compute the PSNR between the source images and the rendered images). I used the Blender Photogrammetry Importer addon (version 3.2.1) and I was able to import cameras poses and textured mesh into Blender (version 3.5.1). I then rendered and saved the images using a Python script in Blender (I iterated through the reconstruction cameras and rendered the images). I run into the following problem: when importing the reconstructed cameras in Blender, some of the camera parameters are off, e.g the FOV and Shift X and Y and because of that the rendered images are not the expected ones. With some trial and error I was able to approximate the values for these parameters, but I am concerned that by doing this will impact the accuracy of the PSNR value. Could you help me please resolve this problem?

Thank you!

SBCV commented 5 months ago

Have you seen this: https://blender-photogrammetry-importer.readthedocs.io/en/latest/alignment.html ?

catalinad commented 4 months ago

Hi, thank you for your reply. Unfortunately that didn't fix the issue. I ended up manually setting the value for the FOV and setting Shift X and Y to 0.

SBCV commented 4 months ago

The addon should correctly set the values for the fov and the shift. So there is a bug in the addon? Can you share the example? Or a small example to highlight the problem?

ElHouas commented 1 month ago

Hey @SBCV

I found the same issue when importing the json data from OpenSFM, when the reconstrucion.json is generated by PyODM.

What I've done was to convert c_x, c_y from mm to pixels, in my case the results where nearly zero, but the camera was properly aligned.

Is that the right approach?

Thanks!