Reconstruct3D - 三维重建
概述
Reconstruct3D 接口用于从空三结果生成二维和三维模型。通常与 ReconstructAT 配合使用,完成完整的重建流程。该接口支持多种输出格式、分块处理和精细的参数控制。
适用场景
- 从空三结果生成三维模型
- 生成正射影像和数字表面模型
- 大规模数据的分块重建
- 需要特定输出格式
接口调用
命令行调用
reconstruct_full_engine(.exe) --reconstruct_type 2 --task_json config_task.json
参数说明
reconstruct_type: 固定为2(表示 Reconstruct3D)task_json: 配置文件路径
配置参数
必需参数
| 参数名 | 类型 | 说明 |
|---|---|---|
working_dir | string | 工作目录(必须与空三接口所指定相同) |
gdal_folder | string | GDAL 数据路径 |
可选参数
基础参数
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
input_image_type | int | 0 | 图像类型:1=RGB,2=多光谱,3=红外 |
resolution_level | int | 1 | 重建精度:1=高精度,2=中精度,3=低精度 |
pipeline_mode | int | 0 | 重建管线:0=纯视觉重建 1=纯激光雷达点云重建 |
reconstruct_mode | int | 0 | 重建模式:0=一般场景,2=电力线场景 |
coordinate_system_3d | JSON | - | 输出三维结果的坐标系,格式查看coordinate_system |
coordinate_system_2d | JSON | - | 输出二维结果的坐标系 |
min_avali_memory_size | double | 0 | 最小可用内存(GB),用于控制分块数量 |
fast_mode | bool | false | 快速模式,提高效率但降低细节 |
keep_undistort_images | bool | false | 是否保留去畸变图像 |
输出格式控制 [必须指定其中一种]
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
generate_osgb | bool | false | 生成 OSGB 格式三维模型 |
generate_3d_tiles | bool | false | 生成 3D Tiles (b3dm) 格式 |
generate_las | bool | false | 生成 LAS 格式点云 |
generate_pc_ply | bool | false | 生成 PLY 格式点云 |
generate_pc_osgb | bool | false | 生成 OSGB 格式点云 LOD |
generate_pc_pnts | bool | false | 生成 pnts 格式点云 LOD |
generate_gs_ply* | bool | false | 生成 PLY 格式高斯泼溅成果 |
generate_gs_sog | bool | false | 生成 SOG 格式,体积压缩后的高斯泼溅成果 |
generate_gs_splat_sog_tiles | bool | false | 生成 SOG Tiles 格式,适用于大规模渲染的高斯泼溅成果 |
generate_obj | bool | false | 生成 OBJ 格式纹理网格 |
generate_ply | bool | false | 生成 PLY 格式纹理网格 |
generate_geotiff | bool | false | 生成 GeoTIFF 格式正射影像 |
generate_tile_2D | bool | false | 对正射影像进行瓦片切分 |
generate_2D_from_3D_model | bool | false | 从三维模型生成二维正射影像 |
[重要] Windwos系统生成高斯泼溅成果需要下载高斯插件,下载地址:高斯插件,下载后解压并将所有 dll 格式文件存放在 reconstruct_full_engine 同级目录
ROI控制
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
roi_for_2d | JSON | - | 二维重建的感兴趣区域,格式查看ROI结构释义 |
roi_for_3d | JSON | - | 三维重建的感兴趣区域 |
roi_coordinate_system | JSON | WGS84 | ROI 的坐标系 |
ROI结构释义
| 字段名 | 类型 | 说明 |
|---|---|---|
boundary | array | ROI多边形的2D边界顶点集合 |
min_z | double | ROI最小高程 |
max_z | double | ROI最大高程 |
示例:
{
"boundary": [ // 2D 多边形边界(逆时针)
[x1, y1],
[x2, y2],
[x3, y3]
// ...
],
"min_z": 100.0, // 最小高程
"max_z": 500.0 // 最大高程
}
高级参数
更多高级参数请查看 高级参数
完整配置示例
基础三维重建
{
"working_dir": "C:/Projects/3D_Task",
"gdal_folder": "C:/MipMap/SDK/data",
"input_image_type": 1,
"resolution_level": 1,
"generate_osgb": true,
"generate_3d_tiles": true,
"generate_geotiff": true
}
指定输出成果坐标系
{
"working_dir": "C:/Projects/3D_Task",
"gdal_folder": "C:/MipMap/SDK/data",
"input_image_type": 1,
"resolution_level": 1,
"generate_osgb": true,
"generate_3d_tiles": true,
"generate_geotiff": true,
"coordinate_system_3d": {
"type": 3,
"epsg_code": 32650 // WGS84 / UTM 50N
},
"coordinate_system_2d": {
"type": 3,
"epsg_code": 32650 // WGS84 / UTM 50N
}
}
设定重建ROI
{
"working_dir": "C:/Projects/3D_Task",
"gdal_folder": "C:/MipMap/SDK/data",
"input_image_type": 1,
"resolution_level": 1,
"roi_for_3d": {
"boundary": [
[114.12, 22.12],
[114.13, 22.12],
[114.13, 22.13],
[114.12, 22.13]
],
"min_z": 0,
"max_z": 500
},
"generate_osgb": true,
"generate_3d_tiles": true,
"generate_geotiff": true,
"coordinate_system_3d": {
"type": 3,
"epsg_code": 32650 // WGS84 / UTM 50N
},
"coordinate_system_2d": {
"type": 3,
"epsg_code": 32650 // WGS84 / UTM 50N
}
}
输出结果
三维模型输出 (/3D/)
model-osgb/- OSGB 格式模型和 LODmodel-b3dm/- 3D Tiles 格式(含 tileset.json)model-obj/- OBJ 格式模型和纹理point-las/- LAS 格式点云point-ply/- PLY 格式点云point-osgb/- OSGB 格式点云 LODpoint-pnts/- 3D Tiles 点云格式point-gs-ply/- 3DGS-PLY点云格式
二维产品输出 (/2D/)
geotiffs/- GeoTIFF 格式正射影像和 DSMdom_tiles/- 正射影像瓦片dsm_tiles/- 数字表面模型瓦片
分辨率等级说明
| 等级 | 说明 | 相对处理时间 | 适用场景 |
|---|---|---|---|
| 1 | 超高精度 | 3-5x | 专业测绘、文物保护 |
| 2 | 高精度 | 1x | 一般工程应用 |
| 3 | 快速预览 | 0.2-0.3x | 快速验证、预览 |
错误处理
接口返回整数错误码:
0: 成功非0: 各种错误情况
详见错误码。
常见问题
Q: 提示"找不到空三结果"
A: 确保:
working_dir与 ReconstructAT 使用的相同- 空三已成功完成
- milestones 目录包含 mvs.pb.bin 文件
Q: 内存不足错误
A:
- 设置
min_avali_memory_size限制内存使用 - 降低
resolution_level - 使用 DivideTiles 进行预分块
Q: 输出坐标不正确
A:
- 检查
coordinate_system_3d/2d设置 - 确认 ROI 坐标系与数据匹配
- 验证 GDAL 数据路径正确
下一步
提示:Reconstruct3D 提供了丰富的输出选项。建议先用低精度快速验证,再进行高质量重建。