Skip to content

Commit

Permalink
Merge pull request #13 from OpenDroneMap/master
Browse files Browse the repository at this point in the history
Bring in latest master
  • Loading branch information
smathermather authored Apr 4, 2019
2 parents 9534e52 + ed58c36 commit eea3119
Show file tree
Hide file tree
Showing 38 changed files with 2,410 additions and 582 deletions.
119 changes: 97 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,91 @@ FROM phusion/baseimage
# Env variables
ENV DEBIAN_FRONTEND noninteractive

#Install dependencies
RUN apt-get update -y
RUN apt-get install software-properties-common -y
#Required Requisites
RUN add-apt-repository -y ppa:ubuntugis/ppa
RUN add-apt-repository -y ppa:george-edison55/cmake-3.x
RUN apt-get update -y
#Install dependencies and required requisites
RUN apt-get update -y \
&& apt-get install -y \
software-properties-common \
&& add-apt-repository -y ppa:ubuntugis/ppa \
&& add-apt-repository -y ppa:george-edison55/cmake-3.x \
&& apt-get update -y

# All packages (Will install much faster)
RUN apt-get install --no-install-recommends -y git cmake python-pip build-essential software-properties-common python-software-properties libgdal-dev gdal-bin libgeotiff-dev \
libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libflann-dev \
libproj-dev libxext-dev liblapack-dev libeigen3-dev libvtk6-dev python-networkx libgoogle-glog-dev libsuitesparse-dev libboost-filesystem-dev libboost-iostreams-dev \
libboost-regex-dev libboost-python-dev libboost-date-time-dev libboost-thread-dev python-pyproj python-empy python-nose python-pyside python-scipy \
liblas-bin python-matplotlib libatlas-base-dev swig2.0 python-wheel libboost-log-dev libjsoncpp-dev python-gdal
RUN apt-get install --no-install-recommends -y \
build-essential \
cmake \
gdal-bin \
git \
libatlas-base-dev \
libavcodec-dev \
libavformat-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-log-dev \
libboost-python-dev \
libboost-regex-dev \
libboost-thread-dev \
libeigen3-dev \
libflann-dev \
libgdal-dev \
libgeotiff-dev \
libgoogle-glog-dev \
libgtk2.0-dev \
libjasper-dev \
libjpeg-dev \
libjsoncpp-dev \
liblapack-dev \
liblas-bin \
libpng-dev \
libproj-dev \
libsuitesparse-dev \
libswscale-dev \
libtbb2 \
libtbb-dev \
libtiff-dev \
libvtk6-dev \
libxext-dev \
python-dev \
python-empy \
python-gdal \
python-matplotlib \
python-networkx \
python-nose \
python-pip \
python-pyproj \
python-pyside \
python-software-properties \
python-wheel \
swig2.0

RUN apt-get remove libdc1394-22-dev
RUN pip install --upgrade pip
RUN pip install setuptools
RUN pip install -U PyYAML exifread gpxpy xmltodict catkin-pkg appsettings https://github.com/gipit/gippy/archive/1.0.0.zip loky shapely numpy pyproj psutil repoze.lru && pip install -U scipy --ignore-installed
RUN pip install -U \
appsettings \
catkin-pkg \
exifread \
gpxpy \
loky \
numpy==1.15.4 \
psutil \
pyproj \
PyYAML \
repoze.lru \
scipy \
shapely \
xmltodict \
https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip

ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages"
ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/src/opensfm"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"

# Prepare directories

RUN mkdir /code
WORKDIR /code

# Copy repository files
COPY ccd_defs_check.py /code/ccd_defs_check.py
COPY CMakeLists.txt /code/CMakeLists.txt
COPY configure.sh /code/configure.sh
COPY /modules/ /code/modules/
Expand All @@ -47,20 +101,41 @@ COPY /SuperBuild/CMakeLists.txt /code/SuperBuild/CMakeLists.txt
COPY docker.settings.yaml /code/settings.yaml
COPY VERSION /code/VERSION

# Compile code in SuperBuild and root directories
RUN cd SuperBuild \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make -j$(nproc) \
&& cd ../.. \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make -j$(nproc)

RUN apt-get -y remove \
git \
build-essential \
cmake \
libgl1-mesa-dri \
python-pip

#Compile code in SuperBuild and root directories

RUN cd SuperBuild && mkdir build && cd build && cmake .. && make -j$(nproc) && cd ../.. && mkdir build && cd build && cmake .. && make -j$(nproc)

RUN apt-get -y remove libgl1-mesa-dri git cmake python-pip build-essential
RUN apt-get install -y libvtk6-dev

# Cleanup APT
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Clean Superbuild

RUN rm -rf /code/SuperBuild/download /code/SuperBuild/src/opencv /code/SuperBuild/src/pcl /code/SuperBuild/src/pdal /code/SuperBuild/src/opengv /code/SuperBuild/src/mvstexturing /code/SuperBuild/src/ceres /code/SuperBuild/build/opencv /code/SuperBuild/src/exiv2lib
RUN rm -rf \
/code/SuperBuild/build/opencv \
/code/SuperBuild/download \
/code/SuperBuild/src/ceres \
/code/SuperBuild/src/exiv2lib \
/code/SuperBuild/src/mvstexturing \
/code/SuperBuild/src/opencv \
/code/SuperBuild/src/opengv \
/code/SuperBuild/src/pcl \
/code/SuperBuild/src/pdal

# Entry point
ENTRYPOINT ["python", "/code/run.py", "code"]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ docker run -it --rm \
-v "$(pwd)/images:/code/images" \
-v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
-v "$(pwd)/odm_texturing:/code/odm_texturing" \
opendronemap/opendronemap
opendronemap/odm
```

### Native Install (Ubuntu 16.04)
Expand Down Expand Up @@ -167,7 +167,7 @@ instructions through "Create a Docker group". Once Docker is installed, the fast
-v "$(pwd)/images:/code/images" \
-v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
-v "$(pwd)/odm_texturing:/code/odm_texturing" \
opendronemap/opendronemap
opendronemap/odm

If you want to build your own Docker image from sources, type:

Expand Down Expand Up @@ -200,15 +200,15 @@ If you want to get all intermediate outputs, run the following command:
-v "$(pwd)/odm_texturing:/code/odm_texturing" \
-v "$(pwd)/opensfm:/code/opensfm" \
-v "$(pwd)/smvs:/code/smvs" \
opendronemap/opendronemap
opendronemap/odm

To pass in custom parameters to the run.py script, simply pass it as arguments to the `docker run` command. For example:

docker run -it --rm \
-v "$(pwd)/images:/code/images" \
-v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
-v "$(pwd)/odm_texturing:/code/odm_texturing" \
opendronemap/opendronemap --resize-to 1800 --force-ccd 6.16
opendronemap/odm --resize-to 1800

If you want to pass in custom parameters using the settings.yaml file, you can pass it as a -v volume binding:

Expand All @@ -217,7 +217,7 @@ If you want to pass in custom parameters using the settings.yaml file, you can p
-v "$(pwd)/odm_orthophoto:/code/odm_orthophoto" \
-v "$(pwd)/odm_texturing:/code/odm_texturing" \
-v "$(pwd)/settings.yaml:/code/settings.yaml" \
opendronemap/opendronemap
opendronemap/odm

When building your own Docker image, if image size is of importance to you, you should use the ```--squash``` flag, like so:

Expand Down
6 changes: 3 additions & 3 deletions SuperBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ SETUP_EXTERNAL_PROJECT(OpenCV ${ODM_OpenCV_Version} ${ODM_BUILD_OpenCV})
# ---------------------------------------------------------------------------------------------
# Point Cloud Library (PCL)
#
set(ODM_PCL_Version 1.7.2)
set(ODM_PCL_Version 1.8.0)
option(ODM_BUILD_PCL "Force to build PCL library" OFF)

SETUP_EXTERNAL_PROJECT(PCL ${ODM_PCL_Version} ${ODM_BUILD_PCL})
Expand Down Expand Up @@ -132,7 +132,7 @@ endforeach()

externalproject_add(mve
GIT_REPOSITORY https://github.com/simonfuhrmann/mve.git
GIT_TAG 2106a5b0aef61a7f744551510b1b4c5d8e3be594
GIT_TAG fb942b4458dbf8490c9a4c6b81b9b9f57c593c0f
UPDATE_COMMAND ""
SOURCE_DIR ${SB_SOURCE_DIR}/elibs/mve
CONFIGURE_COMMAND ""
Expand Down Expand Up @@ -182,4 +182,4 @@ externalproject_add(dem2points
BUILD_IN_SOURCE 1
BUILD_COMMAND make
INSTALL_COMMAND ""
)
)
2 changes: 1 addition & 1 deletion SuperBuild/cmake/External-Exiv2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ExternalProject_Add(${_proj_name}
TMP_DIR ${_SB_BINARY_DIR}/tmp
STAMP_DIR ${_SB_BINARY_DIR}/stamp
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}/${_proj_name}
URL http://www.exiv2.org/builds/exiv2-0.27.0-Source.tar.gz
URL https://github.com/Exiv2/exiv2/archive/0.27.tar.gz
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${SB_INSTALL_DIR}
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/cmake/External-PDAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ExternalProject_Add(${_proj_name}
STAMP_DIR ${_SB_BINARY_DIR}/stamp
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
URL https://github.com/PDAL/PDAL/archive/1.6.zip
URL https://github.com/PDAL/PDAL/archive/1.8.0.zip
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------
Expand Down
25 changes: 0 additions & 25 deletions ccd_defs_check.py

This file was deleted.

5 changes: 1 addition & 4 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ install() {
libboost-log-dev

echo "Installing split-merge Dependencies"
pip install -U scipy shapely numpy pyproj

pip install -U https://github.com/gipit/gippy/archive/1.0.0.zip psutil

pip install -U scipy numpy==1.15.4 shapely pyproj https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip psutil

echo "Compiling SuperBuild"
cd ${RUNPATH}/SuperBuild
Expand Down
7 changes: 3 additions & 4 deletions core2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ RUN apt-get update -y

# All packages (Will install much faster)
RUN apt-get install --no-install-recommends -y git cmake python-pip build-essential software-properties-common python-software-properties libgdal-dev gdal-bin libgeotiff-dev \
libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libflann-dev \
libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev python-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libflann-dev \
libproj-dev libxext-dev liblapack-dev libeigen3-dev libvtk6-dev python-networkx libgoogle-glog-dev libsuitesparse-dev libboost-filesystem-dev libboost-iostreams-dev \
libboost-regex-dev libboost-python-dev libboost-date-time-dev libboost-thread-dev python-pyproj python-empy python-nose python-pyside python-scipy \
libboost-regex-dev libboost-python-dev libboost-date-time-dev libboost-thread-dev python-pyproj python-empy python-nose python-pyside \
liblas-bin python-matplotlib libatlas-base-dev swig2.0 python-wheel libboost-log-dev libjsoncpp-dev python-gdal

RUN apt-get remove libdc1394-22-dev
RUN pip install --upgrade pip
RUN pip install setuptools
RUN pip install -U PyYAML exifread gpxpy xmltodict catkin-pkg appsettings https://github.com/gipit/gippy/archive/1.0.0.zip loky shapely numpy pyproj psutil repoze.lru && pip install -U scipy --ignore-installed
RUN pip install -U PyYAML exifread gpxpy xmltodict catkin-pkg appsettings https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip loky shapely scipy numpy==1.15.4 pyproj psutil repoze.lru

ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages"
ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/src/opensfm"
Expand All @@ -31,7 +31,6 @@ RUN mkdir /code
WORKDIR /code

# Copy repository files
COPY ccd_defs_check.py /code/ccd_defs_check.py
COPY CMakeLists.txt /code/CMakeLists.txt
COPY configure.sh /code/configure.sh
COPY /modules/ /code/modules/
Expand Down
2 changes: 2 additions & 0 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ add_subdirectory(odm_extract_utm)
add_subdirectory(odm_georef)
add_subdirectory(odm_orthophoto)
add_subdirectory(odm_cleanmesh)
add_subdirectory(odm_filterpoints)

if (ODM_BUILD_SLAM)
add_subdirectory(odm_slam)
endif ()
21 changes: 21 additions & 0 deletions modules/odm_filterpoints/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project(odm_filterpoints)
cmake_minimum_required(VERSION 2.8)

# Add compiler options.
add_definitions(-Wall -Wextra -Wconversion -pedantic -std=c++11)

# PDAL and jsoncpp
find_package(PDAL REQUIRED CONFIG)
include_directories(${PDAL_INCLUDE_DIRS})
include_directories("${PROJECT_SOURCE_DIR}/../../SuperBuild/src/pdal/vendor/jsoncpp/dist")
link_directories(${PDAL_LIBRARY_DIRS})
add_definitions(${PDAL_DEFINITIONS})

# Add source directory
aux_source_directory("./src" SRC_LIST)

# Add exectuteable
add_executable(${PROJECT_NAME} ${SRC_LIST})

# Link
target_link_libraries(${PROJECT_NAME} jsoncpp ${PDAL_LIBRARIES})
Loading

0 comments on commit eea3119

Please sign in to comment.