跳到主要内容

ReconstructAT - 空中三角测量

概述

ReconstructAT 接口用于执行空中三角测量(Aerotriangulation),是专业用户进行精细控制的首选接口。该接口提供了详细的参数设置,支持相机分组、POS 导入、控制点导入等高级功能。

适用场景
  • 需要精细控制空三参数
  • 需要检查和优化空三结果
  • 多相机系统重建
  • 需要集成控制点

接口调用

命令行调用

reconstruct_full_engine.exe -reconstruct_type 1 -task_json at_config.json

参数说明

  • reconstruct_type: 固定为 1(表示 ReconstructAT)
  • task_json: 配置文件路径

配置参数

必需参数

参数名类型说明
license_idintSDK 许可证代码,统一为 9200
working_dirstring工作目录,保存中间文件和最终结果
gdal_folderstringGDAL 数据路径(SDK 外部数据文件夹)
coordinate_systemJSON输入图像位置的坐标系统
image_meta_dataJSON Array输入图像的元数据信息
camera_meta_dataJSON Array相机元数据信息

可选参数

参数名类型默认值说明
input_image_typeint1图像类型:1=RGB,2=多光谱,3=红外
remove_small_partboolfalse是否移除空三结果中的小连通分量
output_tie_point_lasboolfalse是否输出 LAS 格式的连接点云
output_block_change_xmlbooltrue是否输出 ContextCapture XML 格式的空三结果
coordinate_system_ATJSON-输出 XML 格式空三结果的坐标系
fast_modeboolfalse快速模式,适用于有 GPS 的数据
use_image_position_constraintbooltrue是否使用图像位置信息作为约束
use_voc_indexbooltrue是否使用图像检索进行匹配对搜索
use_spatial_indexbooltrue是否使用 GPS 距离进行匹配对搜索

数据结构说明

图像元数据(Image Metadata)

{
"id": 1, // 图像唯一 ID
"path": "path/to/image.jpg", // 图像绝对路径
"group": "camera_1", // 相机组 ID(可选)
"meta_data": { // 图像信息(必需)
"width": 6000, // 图像宽度(像素)
"height": 4000, // 图像高度(像素)
"camera_id": 1, // 对应相机 ID(可选,如果提供了 'pre_calib_param' 参数,将被相机元数据覆盖)
"pos": [lon, lat, alt], // 位置 [经度, 纬度, 高程]
"pos_sigma": [1.0, 1.0, 2.0], // 位置精度(米)
"orientation": [...], // 旋转矩阵(9个值,可选)
"position_constant": false, // 是否固定位置
"relative_altitude": 100.0, // 相对飞行高度(可选)
"focal_length_in_35mm": 24, // 35mm 等效焦距
"pre_calib_param": [...], // 预标定参数(可选,如果提供了 'focal_length_in_35mm' 参数,将被覆盖)
"dewarp_flag": false // 畸变校正标志(可选,来自DJI XMP数据)
}
}

相机元数据(Camera Metadata)

{
"id": 1, // 相机唯一 ID
"meta_data": {
"camera_name": "DJI FC6310", // 相机名称
"width": 6000, // 传感器宽度(像素)
"height": 4000, // 传感器高度(像素)
"parameters": [ // 相机内参(可选,10元素数组,placeholder_param当前为占位参数)
// fx, fy, cx, cy, k1, k2, p1, p2, k3,placeholder_param
]
}
}

坐标系统(Coordinate System)

{
"type": 2, // 0=LocalENU, 1=Local, 2=Geographic, 3=Projected, 4=ECEF
"epsg_code": 4326, // EPSG 代码(Geographic/Projected/ECEF 需要)
"wkt": "...", // WKT 字符串(可替代 epsg_code)
"origin_point": [lon, lat, alt], // LocalENU 原点(仅 type=0 需要)
"offset": [0, 0, 0] // 相对坐标系原点的偏移
}

完整配置示例

基础空三配置

{
"license_id": 9200,
"working_dir": "C:/Projects/AT_Task",
"gdal_folder": "C:/MipMap/SDK/data",
"coordinate_system": {
"type": 2,
"epsg_code": 4326
},
"camera_meta_data": [
{
"id": 1,
"meta_data": {
"camera_name": "DJI FC6310",
"width": 5472,
"height": 3648
}
}
],
"image_meta_data": [
{
"id": 1,
"path": "C:/Images/DJI_0001.JPG",
"meta_data": {
"width": 5472,
"height": 3648,
"camera_id": 1,
"pos": [114.123456, 22.123456, 100.5],
"pos_sigma": [2.0, 2.0, 3.0]
}
},
{
"id": 2,
"path": "C:/Images/DJI_0002.JPG",
"meta_data": {
"width": 5472,
"height": 3648,
"camera_id": 1,
"pos": [114.123556, 22.123456, 100.8],
"pos_sigma": [2.0, 2.0, 3.0]
}
}
],
"output_tie_point_las": true,
"output_block_change_xml": true
}

多相机组配置

{
"license_id": 9200,
"working_dir": "C:/Projects/MultiCamera_AT",
"gdal_folder": "C:/MipMap/SDK/data",
"coordinate_system": {
"type": 2,
"epsg_code": 4326
},
"camera_meta_data": [
{
"id": 1,
"meta_data": {
"camera_name": "Camera_Nadir",
"width": 6000,
"height": 4000
}
},
{
"id": 2,
"meta_data": {
"camera_name": "Camera_Oblique",
"width": 6000,
"height": 4000
}
}
],
"image_meta_data": [
{
"id": 1,
"path": "nadir/IMG_0001.JPG",
"group": "nadir",
"meta_data": {
"width": 6000,
"height": 4000,
"camera_id": 1,
"pos": [114.123456, 22.123456, 200.0],
"pos_sigma": [0.05, 0.05, 0.10]
}
},
{
"id": 2,
"path": "oblique/IMG_0001.JPG",
"group": "oblique_forward",
"meta_data": {
"width": 6000,
"height": 4000,
"camera_id": 2,
"pos": [114.123456, 22.123456, 200.0],
"pos_sigma": [0.05, 0.05, 0.10]
}
}
],
"fast_mode": true
}

高精度 RTK/PPK 配置

{
"license_id": 9200,
"working_dir": "C:/Projects/RTK_AT",
"gdal_folder": "C:/MipMap/SDK/data",
"coordinate_system": {
"type": 2,
"epsg_code": 4326
},
"camera_meta_data": [
{
"id": 1,
"meta_data": {
"camera_name": "DJI P1",
"width": 8192,
"height": 5460,
"parameters": [8839.5, 8839.5, 4096, 2730, 0, 0, 0, 0, 0, 0]
}
}
],
"image_meta_data": [
{
"id": 1,
"path": "C:/RTK_Images/IMG_0001.JPG",
"meta_data": {
"width": 8192,
"height": 5460,
"camera_id": 1,
"pos": [114.12345678, 22.12345678, 150.123],
"pos_sigma": [0.02, 0.02, 0.05], // 高精度 RTK
"orientation": [
// 3x3 旋转矩阵(如果有 IMU 数据)
]
}
}
],
"use_image_position_constraint": true
}

输出结果

空三完成后,会在工作目录中生成:

1. 中间结果目录 (milestones/)

  • mvs.xml - 内部格式的空三结果
  • mvs_undistort.xml - 去畸变后的空三结果
  • roi.json - 自动计算的感兴趣区域
  • cs.json - 坐标系统信息
  • tie_points.las - 连接点云(如果启用)

2. 导出结果 (products/AT/)

  • block_exchange.xml - ContextCapture 格式的空三结果(如果启用)

3. 日志文件 (log/)

  • log.txt - 详细处理日志

ROI 使用说明

空三完成后生成的 roi.json 包含三种类型的 ROI:

{
"rois": [
{
"type": "Smart", // 基于稀疏点智能计算
"roi": {
"boundary": [...], // 2D 边界顶点
"min_z": 100.0, // 最小高程
"max_z": 200.0 // 最大高程
}
},
{
"type": "Maximal", // 基于图像位置和稀疏点
"roi": {...}
},
{
"type": "Frustum", // 基于图像视锥
"roi": {...}
}
]
}

最佳实践

1. 图像准备

  • 确保图像 EXIF 包含完整的 GPS 信息
  • 图像重叠度建议 >60%
  • 避免模糊或过曝的图像

2. 参数优化

  • 普通 GPS:使用默认 pos_sigma [2.0, 2.0, 3.0]
  • RTK/PPK:设置更小的 pos_sigma 如 [0.05, 0.05, 0.10]
  • 快速模式:有 GPS 时启用 fast_mode

3. 多相机处理

  • 使用 group 参数标识不同相机
  • 每个相机组使用独立的 camera_id
  • 确保相机参数准确

4. 大数据集优化

  • 启用 fast_mode 加速处理
  • 考虑使用 remove_small_part 清理结果
  • 合理设置内存使用限制

常见问题

Q: 空三失败,提示"图像匹配不足"

A: 检查:

  • 图像重叠度是否足够(>60%)
  • GPS 信息是否准确
  • 图像质量是否良好

Q: 如何提高空三精度?

A:

  • 使用高精度 POS 数据(RTK/PPK)
  • 设置合适的 pos_sigma
  • 使用 OptimizeAT 加入控制点

Q: 多相机系统如何设置?

A:

  • 为每个相机创建独立的 camera_meta_data
  • 使用 group 参数区分不同相机的图像
  • 确保相机内参准确

下一步


提示:ReconstructAT 提供了最大的灵活性,但也需要更多的参数设置。如果您只需要快速重建,建议使用 ReconstructFull