Linux版本OPALS安装包下载
- 下载地址(需要注册邮箱账号):opals.geo.tuwien.ac.at/html/stable…
下载下图中 linux 版本
基础安装 流程
- 安装 OPALS 需要的
libssl1.1
wget https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_amd64.deb:下载libssl1.1 的 Debian 软件包;
sudo dpkg -i libssl1.1_1.1.1n-0+deb10u6_amd64.deb :安装下载的 libssl1.1 包。
- 安装 Python 包管理器和重命名工具
sudo apt --yes install python3-pip rename
- 升级 OPALS 需要的 Python 库 NumPy、SciPy 和 Matplotlib
pip install --upgrade numpy scipy matplotlib
若无法访问 Google,可以使用清华镜像源下载:
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
- 解压 OPALS 并进入 OPALS 目录
tar -xzf opals_2.6.0_linux64.tar.gz
cd opals_2.6.0/opals
- 默认情况下,OPALS 依赖于 Python3.8。可以先执行命令
python3 --version确认系统的 Python 版本。
因为 OPALS 可以重新配置不同的 Python 版本,所以不需要额外下载 python3.8。
- 配置 OPALS 使用 Python3.10
cp python/3.10/libgeo_python_proxy.so .
- 移除重复的共享库文件
for so in *.so *.so.*; do if [ "$(ldconfig -p | tail -n +2 | awk '{print $1}' | grep -Fx $so)" ]; then rm -v $so; fi; done
- 重命名共享库文件
cd lib/python3/dist-packages/osgeo/
rename -v 's/.cpython-38-x86_64-linux-gnu././' *.so
至此完成基础安装。
可选安装
安装依赖于 MATLAB 的 OPALS 模块
包括可视化模块(Module View)、ICP 模块(Module ICP)以及平差模块(Module StripAdjust),这些模块需要安装 MATLAB Compiler Runtime。
在 Linux 上,必须单独下载 MATLAB Compiler Runtime 并将其安装到默认文件夹 ( /usr/local/MATLAB/MATLAB_Runtime)。执行以下命令实现:
- 创建目录并进入目录
mkdir mcr && cd mcr
- 下载 MCR 安装文件
wget https://ssd.mathworks.com/supportfiles/downloads/R2017b/deployment_files/R2017b/installers/glnxa64/MCR_R2017b_glnxa64_installer.zip
- 解压安装文件
unzip MCR_R2017b_glnxa64_installer.zip
- 进行静默安装
sudo -H ./install -mode silent -agreeToLicense yes
- 清理安装文件
cd .. && rm -rf mcr
OPALS 安装检查
- 进入相关目录,启动交互式 OPALS shell
cd OPALS/opals_2.6.0/
./opalsShell.sh
- 进入目录 $OPALS_ROOT/demo/
cd demo
依次执行以下命令:
1、opalsImport -inFile test.xyz :将点云数据 test.xyz 导入 OPALS 数据管理系统(ODM)。
2、opalsGrid -inFile test.odm -outFile test.tif -interpolation movingPlanes -gridSize 1 :将导入的点云数据进行栅格化,并生成数字表面模型(DSM)。
opalsGrid:OPALS 模块,用于将点云数据栅格化。
-inFile test.odm:指定输入文件为 test.odm,这是前一步导入的点云数据文件。
-outFile test.tif:指定输出文件为 test.tif,生成的栅格文件。
-interpolation movingPlanes:使用移动平面插值方法来计算栅格值。
-gridSize 1:设置栅格的大小为 1(单位取决于数据的单位,通常是米),即生成 1 米分辨率的栅格。
3、opalsZColor -inFile test.tif -nClasses 20 :对生成的栅格数据进行高度分类,并为不同高度范围指定不同的颜色。
opalsZColor:OPALS 模块,用于根据高度(Z 值)给栅格数据着色。
-inFile test.tif:指定输入文件为 test.tif,这是前一步生成的栅格文件。
-nClasses 20:将高度数据分为 20 个类别,并为每个类别指定不同的颜色。
生成的数字表面模型的彩色可视化如下:
至此,OPALS 安装完毕!
加载点云
- 打开 OPALS bash 脚本
- 进入点云数据所在目录
- 执行命令
opalsView -inFile 文件名进入 opalsView 并打开指定文件。