SBCV / Blender-Addon-Photogrammetry-Importer

Addon to import different photogrammetry formats into Blender
MIT License
889 stars 78 forks source link

No camera imported while importing NVM from the example and my personal nvm file from agisoft metashape in blender 3.1.1 #46

Closed fairwelljack closed 2 years ago

fairwelljack commented 2 years ago

Hi,

I'm trying to let blender read my camera info and combine them into an animated camera by using this plugin. I imported my personal nvm file that i exported from metashape (camera - > export -> select nvm format) into blender and checked add camera motion as an animation. but there is no camera shown in blender only point cloud.

So i tried with the provided examples - VisualSFM_example.nvm. It still only imported point cloud. please help.

Thanks in advance! J

SBCV commented 2 years ago

Hi,

the reason for this is that NVM files do not contain information of the image sizes used for reconstruction. However, this information is required to create the cameras.

While, importing you should see something like this: (in your Blender-info-panel)

image

From the documentation:

The addon automatically looks for the fixed calibration line in the NVM file (i.e. NVM_V3 FixedK fx cx fy cy r (first line)). Without the fixed calibration line the addon assumes that the principal point is at the image center. NVM files contain no information about the size of the images. Use the import dialog to adjust the image path to automatically read the image size from disc or set the default width and height values.

Option 1: In order to read the image sizes from disk you need to install the pillow dependency of the addon. If you have pillow installed, then use the image directory option to read the image sizes from disk (see image below). This is the recommended way, since it supports individual image sizes for each image.

Option 2: If your images have all the same size, then you can also use Default Width and Default Height to set the width and height values for each image (see image below).

image

fairwelljack commented 2 years ago

Hi, thank you for replying. It works! The only things, everytime i open blender, the dependencies are gone that i need to reinstall them again havent figure out a solution for it but it is not a big issue.

SBCV commented 2 years ago

Mh, that should not be the case. But the dependency handling in Blender is quite messy - so there might be a bug in the visualization.

Can you go to Blender's Python console and check if you can import the dependencies? You should be able to import the dependencies without any errors, like from pyntcloud import PyntCloud

fairwelljack commented 2 years ago

thanks for sharing. I saw the dependecies was automatically installed uder AppData\Roaming\Python\Python310\site-packages
Is it the correct path that dependencies supposed to go? thx!

SBCV commented 2 years ago

Can you go to Blender's Python console and check if you can import the dependencies? You should be able to import the dependencies without any errors, like from pyntcloud import PyntCloud

Please check if this works, and report the results back to me.

fairwelljack commented 2 years ago

Can you go to Blender's Python console and check if you can import the dependencies? You should be able to import the dependencies without any errors, like from pyntcloud import PyntCloud

Please check if this works, and report the results back to me.

It workes! I believe the thing is blender doesnt follow the preferred path I set. It install dependencies into appdata\roaming folder. I manually cut both the addon itself and dependencies under roaming data and paste to c:\~user\~\blender3.1\~

Thank you for a timely response!