Replace PotreeConverter with entwine

pull/86/head
Piero Toffanin 2019-06-08 14:13:17 -04:00
rodzic eddf5c8f39
commit cd3a69fdf3
3 zmienionych plików z 57 dodań i 75 usunięć

Wyświetl plik

@ -5,36 +5,14 @@ EXPOSE 3000
USER root USER root
RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs python-gdal libboost-dev libboost-program-options-dev git cmake RUN apt-get install -y nodejs python-gdal && npm install -g nodemon && \
RUN npm install -g nodemon ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine
# Build LASzip and PotreeConverter
WORKDIR "/staging"
RUN git clone https://github.com/pierotofy/LAStools /staging/LAStools && \
cd LAStools/LASzip && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make
RUN git clone https://github.com/pierotofy/PotreeConverter /staging/PotreeConverter
RUN cd /staging/PotreeConverter && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=/staging/LAStools/LASzip/dll -DLASZIP_LIBRARY=/staging/LAStools/LASzip/build/src/liblaszip.a .. && \
make && \
make install
RUN mkdir /var/www RUN mkdir /var/www
WORKDIR "/var/www" WORKDIR "/var/www"
#RUN git clone https://github.com/OpenDroneMap/node-OpenDroneMap .
COPY . /var/www COPY . /var/www
RUN npm install && mkdir tmp
RUN npm install
RUN mkdir tmp
ENTRYPOINT ["/usr/bin/nodejs", "/var/www/index.js"] ENTRYPOINT ["/usr/bin/nodejs", "/var/www/index.js"]

Wyświetl plik

@ -52,27 +52,9 @@ This can be also used to access the computation results directly from the file s
If you are already running [ODM](https://github.com/OpenDroneMap/ODM) on Ubuntu natively you can follow these steps: If you are already running [ODM](https://github.com/OpenDroneMap/ODM) on Ubuntu natively you can follow these steps:
1) Install PotreeConverter and LASzip dependency 1) Install Entwine: https://entwine.io/quickstart.html#installation
```bash 2) Install node.js and npm dependencies:
apt-get install -y libboost-dev libboost-program-options-dev
mkdir /staging
git clone https://github.com/pierotofy/LAStools /staging/LAStools
cd LAStools/LASzip
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
git clone https://github.com/pierotofy/PotreeConverter /staging/PotreeConverter
cd /staging/PotreeConverter
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=/staging/LAStools/LASzip/dll -DLASZIP_LIBRARY=/staging/LAStools/LASzip/build/src/liblaszip.a ..
make && sudo make install
```
2) Install gdal2tiles.py script, node.js and npm dependencies
```bash ```bash
sudo curl --silent --location https://deb.nodesource.com/setup_6.x | sudo bash - sudo curl --silent --location https://deb.nodesource.com/setup_6.x | sudo bash -

Wyświetl plik

@ -70,38 +70,60 @@ else
echo "gdal_translate is not installed, will skip MBTiles generation" echo "gdal_translate is not installed, will skip MBTiles generation"
fi fi
# Generate Potree point cloud (if PotreeConverter is available) # Generate point cloud (if entwine or potreeconverter is available)
if hash PotreeConverter 2>/dev/null; then pointcloud_input_path=""
potree_input_path="" for path in "odm_georeferencing/odm_georeferenced_model.laz" \
for path in "odm_georeferencing/odm_georeferenced_model.laz" \ "odm_georeferencing/odm_georeferenced_model.las" \
"odm_georeferencing/odm_georeferenced_model.las" \ "odm_filterpoints/point_cloud.ply" \
"odm_georeferencing/odm_georeferenced_model.ply" \ "opensfm/depthmaps/merged.ply" \
"opensfm/depthmaps/merged.ply" \ "smvs/smvs_dense_point_cloud.ply" \
"smvs/smvs_dense_point_cloud.ply" \ "mve/mve_dense_point_cloud.ply" \
"mve/mve_dense_point_cloud.ply" \ "pmvs/recon0/models/option-0000.ply"; do
"pmvs/recon0/models/option-0000.ply"; do if [ -e $path ]; then
if [ -e $path ]; then echo "Found point cloud: $path"
echo "Found suitable point cloud for PotreeConverter: $path" pointcloud_input_path=$path
potree_input_path=$path break
break fi
fi done
done
if [ ! -z "$potree_input_path" ]; then # Never generate point cloud tiles with split-merge workflows
PotreeConverter $potree_input_path -o potree_pointcloud --overwrite -a RGB CLASSIFICATION if [ -e "submodels" ] && [ -e "entwine_pointcloud" ]; then
pointcloud_input_path=""
# Copy the failsafe PLY point cloud to odm_georeferencing echo "Split-merge dataset with point cloud detected. No need to regenerate point cloud tiles."
# if necessary, otherwise it will not get zipped
if [ "$potree_input_path" == "opensfm/depthmaps/merged.ply" ] || [ "$potree_input_path" == "pmvs/recon0/models/option-0000.ply" ]; then
echo "Copying $potree_input_path to odm_georeferencing/odm_georeferenced_model.ply, even though it's not georeferenced..."
cp $potree_input_path "odm_georeferencing/odm_georeferenced_model.ply"
fi
else
echo "Potree point cloud will not be generated (no suitable input files found)"
fi
else
echo "PotreeConverter is not installed, will skip generation of Potree point cloud"
fi fi
if [ ! -z "$pointcloud_input_path" ]; then
# Copy the failsafe PLY point cloud to odm_georeferencing
# if necessary, otherwise it will not get zipped
if [ "$pointcloud_input_path" == "odm_filterpoints/point_cloud.ply" ] || [ "$pointcloud_input_path" == "opensfm/depthmaps/merged.ply" ] || [ "$pointcloud_input_path" == "pmvs/recon0/models/option-0000.ply" ]; then
echo "Copying $pointcloud_input_path to odm_georeferencing/odm_georeferenced_model.ply, even though it's not georeferenced..."
cp $pointcloud_input_path "odm_georeferencing/odm_georeferenced_model.ply"
fi
if hash entwine 2>/dev/null; then
# Optionally cleanup previous results (from a restart)
if [ -e "entwine_pointcloud" ]; then
rm -fr "entwine_pointcloud"
fi
entwine build --threads $(nproc) --tmp "entwine_pointcloud-tmp" -i "$pointcloud_input_path" -o entwine_pointcloud
# Cleanup
if [ -e "entwine_pointcloud-tmp" ]; then
rm -fr "entwine_pointcloud-tmp"
fi
else
echo "Entwine is not installed, checking if PotreeConverter is available instead..."
if hash PotreeConverter 2>/dev/null; then
PotreeConverter "$pointcloud_input_path" -o potree_pointcloud --overwrite -a RGB CLASSIFICATION
else
echo "PotreeConverter is also not installed, will skip generation of Potree point cloud"
fi
fi
else
echo "Point cloud tiles will not be generated"
fi
echo "Postprocessing: done (•̀ᴗ•́)و!" echo "Postprocessing: done (•̀ᴗ•́)و!"
exit 0 exit 0