I’ve been fiddling around with 3D printing and 3D scanning using the Openscan project. It systematically takes a series of photos that can be stitched together into a 3D model using photogrammetry. This is a great overview and howto: https://blog.prusaprinters.org/photogrammetry-2-3d-scanning-simpler-better-than-ever_29393/
The main tool in the toolchain is ALICE Meshroom. However it requires CUDA. I didn’t have an NVIDIA card locally but I did have a Jetson Nano 2GB so I was curious if you could get Meshroom running a 2GB Nano.
I haven’t fully learned out to use Meshroom, so I can’t say if it’s going to be able to produce a result, but I have been able to get the UI running and it looks promising so I thought I’d share how I got there in case it’s interesting or helpful to someone else.
First you have to “build” Meshroom yourself. It’s a python app so that mostly means getting a bunch of dependencies to install correctly. Start by checking out meshroom GitHub - alicevision/meshroom: 3D Reconstruction Software. The instructions on the INSTALL.md are only marginally useful. Basically you need to run
pip install -r requirements.txt
BUT… that’s going to fail until you’ve successfully gotten PySide2 installed which requires Qt and you’re going to have to build both of these from scratch.
I wanted to make sure that I had a recent version of python with venv and an environment set up so I did this:
sudo apt-get install python3 python3-venv python3 -m venv ~/meshroom-env . ~/meshroom-env/bin/activate
Then I mostly followed the instructions from this post: PySide2 (Qt for python) installation on Jetson Xavier - #5 by Muscle_Oliver with a couple caveats 1. you need the full version of Qt 2. there are a few other dependencies that you have to install.
mkdir ~/deps cd ~/deps wget http://master.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz tar xpf qt-everywhere-src-5.15.2.tar.xz cd qt-everywhere-src-5.15.2 # Now you have to install a few dependencies (not mentioned in the post above) sudo apt-get install xcb libxkbcommon-x11-0 ./configure -xcb make -j4 sudo make install
Hopefully all of that goes well… If not you more than likely ran into a missing dependency that I forgot to document. Once you’ve successfully built and installed Qt then you will also need to install some fonts. If you don’t do this you will discover this later then you try to run Meshroom and the UI has no text. NOTE that it may be possible to configure to use fontconfig but I didn’t try to make that happen.
cd ~/deps # Download the font pack from here: https://dejavu-fonts.github.io/ unzip ~/Downloads/dejavu-fonts-ttf-2.37.zip sudo mkdir /usr/local/Qt-5.15.2/lib/fonts sudo cp ~/deps/dejavu-fonts-ttf-2.37/ttf/*.ttf /usr/local/Qt-5.15.2/lib/fonts
Now we need to install PySide2 per the post above… NOTE that the version that is needed by Meshroom as of this post is 5.14.1 (if it’s a different version in the future you’ll be able to tell that when you try to pip install the requirements)
cd ~/deps git clone http://code.qt.io/pyside/pyside-setup.git cd pyside-setup git checkout 5.14.1 sudo python setup.py install --qmake=/usr/local/Qt-5.15.2/bin/qmake
If that all went smoothly then you’re ready to pip install meshroom.
cd ~/meshroom pip install -r requirements.txt
If that goes smoothly then you’re done! To run the UI simply do this
cd ~/meshroom PYTHONPATH=$PWD python meshroom/ui