Awesome
MicMac
- For MicMac v2 (MMVII) click HERE.
Table of Contents
Description
MicMac is a free open-source photogrammetric software for 3D reconstruction under development at the National Institute of Geographic and Forestry Information - French Mapping Agency - (IGN) and the National School of Geographic Sciences (ENSG) withing the LASTIG lab. MicMac is distributed under CECILL-B license since 2007.
Prerequisites
Some external tools need to be present on your system for MicMac to run properly:
- Git to clone the repository
- CMake to generate build files
- make for parallel processes management
- ImageMagick for image format conversion
- exiftool and exiv2 to read/write image meta-data
- PROJ for coordinate system conversion and coordinate reference system transformation
- Xlib to launch some GUI tools based on X window system
- ccache for recompilation optimization (optional)
- Qt to launch some GUI tool based on QT (optionnal)
Installation
This section covers the compilation of MicMac source code to generate binaries. Pre-compiled binaries are available HERE.
Compilation procedure is discribed below for the 3 main operating systems:
Linux Ubuntu distribution
Under Linux (Ubuntu) distribution the installation procedure is as follows:
-
Open a terminal
-
Install dependencies:
sudo apt-get install git cmake make ccache imagemagick libimage-exiftool-perl exiv2 proj-bin libx11-dev qt5-default
-
Clone the repository:
git clone https://github.com/micmacIGN/micmac.git
-
Access the folder:
cd micmac
-
Create a directory for building intermediate files and access it:
mkdir build && cd build
-
Generate makefiles:
cmake ..
-
Compile:
make install -j N
- N is the number of CPUs on the machine and can be retrieved by typing
nproc --all
- N is the number of CPUs on the machine and can be retrieved by typing
-
Add binaries to the
PATH
(adapt the path):echo 'export PATH=/home/src/micmac/bin:$PATH' >> ~/.bashrc
Windows
Under Windows the installation procedure is as follows:
-
Download and Install Build Tools for Visual Studio
-
Download and Install Git
-
Download and Install CMake. Make sure cmake.exe is in the %PATH%
-
Open a Git Bash terminal
-
Optionnal, QT5 tools : Download and Install vcpkg in a general directory (c:\pgms, for example):
git clone https://github.com/microsoft/vcpkg.git cd vcpkg bootstrap-vcpkg.bat vcpkg.exe integrate install
-
Clone the repository:
git clone https://github.com/micmacIGN/micmac.git
-
Access micmac folder:
cd micmac
-
Create a directory for building intermediate files and access it:
mkdir build && cd build
-
Generate Microsoft Visual Studio Solution File MICMAC.sln:
- Without Qt5 Tools:
cmake.exe ..
- With Qt5 Tools (This will download and compile QT5, it will take a very long time):
cmake .. -DWITH_QT5=1 -DCMAKE_TOOLCHAIN_FILE=c:/pgms/vcpkg/script/buildsystem/vcpkg.cmake
-
Compile MicMac:
cmake.exe" --build . --config Release --target INSTALL
-
Add binaries to Windows
PATH
environment variable via Advanced system settings menu. Example of path (adapt the path):"C:\src\micmac\bin"
macOS
Under macOS we will use Homebrew Package Manager to install dependencies.
If you don't have Homebrew, first follow the instructions HERE.
Under macOS the installation procedure is as follows:
-
Open a terminal
-
Use Homebrew to install dependencies:
brew install git brew install cmake brew install imagemagick brew install exiftool brew install exiv2 brew install proj brew install qt5
-
Clone the repository:
git clone https://github.com/micmacIGN/micmac.git
-
Access the folder:
cd micmac
-
Create a directory for building intermediate files and access it:
mkdir build && cd build
-
Generate makefiles:
cmake ..
-
Compile MicMac:
make install -j N
- N is the number of CPUs on the machine
-
Add binaries to the
PATH
(adapt the path):echo 'export PATH=/home/src/micmac/bin:$PATH' >> ~/.zshrc
Additionnal notes
Install Homebrew Package Manager for macOS
- Open a terminal
- Download and run Homebrew installation script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Follow the on-screen instructions to complete the installation
- Add Homebrew to the configuration file of the Zsh shell environment:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
- Execute the commands from the
.zshrc
file in the current shell session:source ~/.zshrc
- Check installation:
brew doctor
Qt Tools (Linux, MacOS)
To use Qt GUIs, you need to adapt the cmake command as follows:
bash cmake ../ -DWITH_QT5=1
Issues
-
In case cmake complains about missing Widgets library, you must assign
CMAKE_PREFIX_PATH
variable:cmake ../ -DWITH_QT5=1 -DCMAKE_PREFIX_PATH=path/to/qt/X.XX.X/
-
For Linux/macOS it is sometimes necessary to append the
lib
directory toLD_LIBRARY_PATH
in.bashrc
/.zshrc
to be able to use Qt tools:- Under Linux :
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/src/micmac/lib/' >> ~/.bashrc
- Under macOS:
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/src/micmac/lib/' >> ~/.zshrc
- Under Linux :
PATH and pre-compiled binaries
You can append the full path of the bin
directory to PATH
environment variable to call MicMac commands from anywhere. However, it is not necessary to add the binaire-aux
directory to the PATH
variable.
MicMac via a Docker image
A precompiled docker image is available and ready to use:
sh docker pull rupnike/micmac
or build your own image from scratch using the existing Dockerfile:
sh docker image build -t micmac:1.0 -f Dockerfile
Run the example dataset
- Download the test dataset available HERE
- unzip the folder and open a terminal inside the folder containing the images
- Run processing scripts:
- under Linux (Ubuntu) distribution:
sh gravillons_test.sh
- under Windows:
./gravillons_test.bat
- under Linux (Ubuntu) distribution:
License
This project is licensed under the CECILL-B License - see the LICENSE.md file for details.