编辑
2026-01-12
课程学习
00

目录

格式规范

BlocksExchange XML 格式是 Bentley 提供的一种开放交换格式,用于在 ContextCapture Master 中导入/导出区块定义。基本上所有三维重建软件的空三都支持该格式。

格式规范

xml
<?xml version="1.0" encoding="utf-8"?> <BlocksExchange version="2.1"> <!-- 定义一个或多个可用的空间参考系统(SRS)。 --> <!-- 这里需要法国 Lambert 93。 --> <SpatialReferenceSystems> <SRS> <!-- 在后续内容中,将通过此 ID 引用该 SRS。 --> <Id>0</Id> <!-- 用户友好的 SRS 名称。 --> <Name>Lambert 93</Name> <!-- 空间参考系统定义可以是 WKT (Well Known Text)、"EPSG:"、PROJ.4,或包含这些定义的文件路径。 --> <Definition>EPSG:2154</Definition> </SRS> </SpatialReferenceSystems> <!-- 可选:当图像路径不是绝对路径时,用于给图像路径加前缀的路径(默认:使用交换文件所在目录)。 --> <BaseImagePath>D:\data\Paris2012sample\Images</BaseImagePath> <!-- 块(Block)定义。一个文件可以定义多个块。 --> <Block> <!-- 块名称与描述是可选的。 --> <Name>Paris2012</Name> <Description>Small sample of the Paris 2012 dataset</Description> <!-- 块类型是可选的。支持的类型:Aerial、Nadir、Orbit。 --> <Type>Aerial</Type> <!-- 可选:可通过 <PhotoDownsamplingRate> 标签提供照片降采样率。 --> <!-- 可选:可通过 <MinimumViewingDistance> 与 <MaximumViewingDistance> 标签提供最小 / 最大观测距离。 --> <!-- 本块使用的基础 SRS 的 ID。默认情况下,空间参考系统被认为是局部笛卡尔坐标系。 --> <SRSId>0</SRSId> <Photogroups> <!-- 所有使用同一物理相机拍摄、且焦距与图像尺寸相同的照片,必须归入同一个 Photogroup。 --> <Photogroup> <!-- 可选:每个 Photogroup 可通过 <SRSId> 指定不同的空间参考系统;默认使用块的 SRS。 --> <!-- 可选:可用 <Name> 提供名称,用 <Description> 提供描述。 --> <Name>UCX</Name> <!-- 图像尺寸,单位像素。 --> <ImageDimensions> <Width>9420</Width> <Height>14430</Height> </ImageDimensions> <!-- 可选:相机模型类型 Perspective 或 Fisheye(未指定则默认 Perspective)。 --> <CameraModelType>Perspective</CameraModelType> <!-- 可选:相机模型波段 Visible 或 Thermal(未指定则默认 Visible)。 --> <CameraModelBand>Visible</CameraModelBand> <!-- 传感器最大边尺寸,单位毫米。 --> <!-- 也可以用传感器像元尺寸(毫米)替代该字段,例如:<PixelSize>0.0072</PixelSize> --> <SensorSize>103.896</SensorSize> <!-- 焦距,单位毫米。可以是标称规格值或更接近的估计值。 --> <FocalLength>100.735601903992</FocalLength> <!-- 可选:以像素为单位的焦距,可替代 FocalLength 与 SensorSize,例如:<FocalLengthPixels>13991.05582</FocalLengthPixels> --> <!-- 可选:指定相机传感器 x / y 轴方向,用于姿态旋转,以及任何以毫米给出的坐标(如 <PrincipalPoint>,以及 <Measurement> 中的 <xmm> / <ymm>)。 --> <!-- 可能取值:XRightYDown(默认)、XRightYUp、XLeftYDown、XLeftYUp、XDownYRight、XDownYLeft、XUpYRight、XUpYLeft --> <CameraOrientation>XRightYDown</CameraOrientation> <!-- 主点,相对于传感器中心。该字段可选:默认用传感器中心作为主点初值。 --> <PrincipalPoint> <!-- 主点二维图像坐标,单位像素。原点为左上角像素中心,x 轴向右,y 轴向下。 --> <x>4683.755692</x> <y>7223.0141002</y> <!-- 也可用相对于传感器中心的二维位置(毫米),此时轴方向由 CameraOrientation 决定,例如: <xmm>-0.1853590176</xmm> <ymm>0.06130152144</ymm> --> </PrincipalPoint> <!-- 镜头畸变系数。该字段可选:默认初值假设无畸变。 --> <!-- 畸变系数对应经典 Brown 畸变模型。 --> <Distortion> <K1>-0.0010041516639</K1> <K2>0.0056007056563</K2> <K3>-0.009874171117100001</K3> <P1>0</P1> <P2>0</P2> </Distortion> <!-- 鱼眼焦距矩阵,仅用于 Fisheye 相机模型类型。 --> <FisheyeFocalMatrix> <M_00>1960</M_00> <M_01>0</M_01> <M_10>0</M_10> <M_11>1960</M_11> </FisheyeFocalMatrix> <!-- 鱼眼畸变系数,仅用于 Fisheye 相机模型类型。 --> <FisheyeDistortion> <P0>0</P0> <P1>1</P1> <P2>0</P2> <P3>0</P3> <P4>0</P4> </FisheyeDistortion> <Photo> <!-- 照片 ID 必须在整个块内唯一(即使跨不同 Photogroup 也不能重复)。 --> <Id>146</Id> <!-- 图像路径:若非绝对路径,则相对于 BaseImagePath(若定义),否则相对于交换文件所在目录。 --> <ImagePath>071_2810.jpg</ImagePath> <!-- 可选:图像掩膜路径。 --> <!-- <MaskPath>071_2810_msk.jpg</MaskPath> --> <!-- 相机外方位元素,可由导航设备或空三估计得到。该字段可选。 --> <!-- 可选:连通分量 ID。1 为主分量(默认),0 表示无分量。姿态不完整的照片不能属于主分量。 --> <!-- <Component>1</Component> --> <Pose> <!-- 在上述空间参考系统中定义的相机三维旋转。 --> <!-- 它定义的旋转矩阵把世界坐标(指定 SRS)变换到相机坐标(轴由 CameraOrientation 定义)。 --> <!-- 旋转是可选的:姿态也可以只包含相机中心三维位置(例如仅有 GPS 位置时)。 --> <Rotation> <!-- 表示方式之一:3 x 3 矩阵(<M_ij>)。 --> <M_00>-0.9999982912233401</M_00> <M_01>-0.001636319085375301</M_01> <M_02>-0.0008602425863163225</M_02> <M_10>-0.001631068695467463</M_10> <M_11>0.9999802528616577</M_11> <M_12>-0.00606906089589293</M_12> <M_20>0.0008701565192966738</M_20> <M_21>-0.006067647409696231</M_21> <M_22>-0.9999812130648239</M_22> <!-- 也可选用 Omega / Phi / Kappa(度),或 Heading / Pitch / Roll(度),或 Yaw / Pitch / Roll(度)表示。 --> </Rotation> <!-- 相机中心三维位置。取决于 SRS,x / y / z 的含义可能不同。 --> <Center> <x>651999.7159189156</x> <y>6863073.633923346</y> <z>1318.897690166719</z> </Center> </Pose> <!-- 可选:可通过 <NearDepth>、<MedianDepth>、<FarDepth> 提供深度信息。 --> <!-- 可选:Exif 数据(每个字段可选)。 --> <!-- <ExifData> <ImageDimensions> <Width>4000</Width> <Height>3000</Height> </ImageDimensions> <PixelDimensions> <Width>0.02</Width> <Height>0.02</Height> </PixelDimensions> <GPS> <Latitude>45.5686684</Latitude> <Longitude>2.6551104</Longitude> <Altitude>1589.5469</Altitude> </GPS> <FocalLength>24</FocalLength> <FocalLength35mmEq>36</FocalLength35mmEq> <Make>FUJIFILM</Make> <Model>FinePix S3Pro</Model> <LensModel>FinePix S3Pro</LensModel> <DateTimeOriginal>2015-04-29T06:40:26</DateTimeOriginal> </ExifData> --> </Photo> </Photogroup> </Photogroups> <!-- 为了获得精确定位,强烈建议使用控制点。 --> <ControlPoints> <!-- 可选:可通过 <SRSId> 指定不同 SRS;默认使用块的 SRS。 --> <ControlPoint> <!-- 控制点名称与描述是可选的。 --> <Name>Control point #1</Name> <!-- 控制点三维位置。取决于 SRS,x / y / z 的含义可能不同。 --> <Position> <x>652788.0525588237</x> <y>6863015.362218254</y> <z>78.07000000122935</z> </Position> <!-- 图像量测。 --> <Measurement> <!-- 发生量测的照片 ID。同一控制点的各量测必须对应不同 PhotoId。 --> <PhotoId>151</PhotoId> <!-- 量测二维图像坐标(像素):原点左上角像素中心,x 向右,y 向下。 --> <!-- 也可用相对于主点的二维位置(毫米):<xmm> / <ymm>,轴方向由 CameraOrientation 决定。 --> <x>7270.31</x> <y>6599.44</y> </Measurement> </ControlPoint> <ControlPoint> <Name>Control point #2</Name> <Position> <x>652123.2211166573</x> <y>6863245.976366176</y> <z>80.07999999914318</z> </Position> <!-- 若指定,则该控制点可作为检查点(默认 false)。 --> <CheckPoint>true</CheckPoint> <!-- 若指定,则控制点可包含精度信息。 --> <HorizontalAccuracy>0.01</HorizontalAccuracy> <VerticalAccuracy>0.10</VerticalAccuracy> <Measurement> <PhotoId>146</PhotoId> <x>3296.56</x> <y>9253.75</y> </Measurement> </ControlPoint> <ControlPoint> <Name>Control point #3</Name> <!-- 若指定,控制点类别可为 Full(默认)、Horizontal 或 Vertical。 --> <Category>Horizontal</Category> <Position> <!-- 无 z 坐标。 --> <x>652365.1205012415</x> <y>6863549.148163618</y> </Position> <!-- 无垂直精度。 --> <HorizontalAccuracy>0.01</HorizontalAccuracy> <Measurement> <PhotoId>95</PhotoId> <x>3178.26</x> <y>4020.21</y> </Measurement> </ControlPoint> </ControlPoints> <!-- 已知连接点(tie points)可用于精化空中三角测量。 --> <TiePoints> <TiePoint> <!-- 连接点名称与描述是可选的。 --> <Name>Tie point #1</Name> <!-- 可选:连接点三维位置。 --> <Position> <x>652119.8871409688</x> <y>6863304.305716386</y> <z>87.79328384995461</z> </Position> <!-- 可选:连接点颜色。 --> <Color> <Red>0.59</Red> <Green>1.0</Green> <Blue>0.0</Blue> </Color> <!-- 图像量测。 --> <Measurement> <!-- 可选:量测类型 User 或 Automatic(未指定则默认 Automatic)。 --> <Type>Automatic</Type> <PhotoId>146</PhotoId> <x>3324.26001</x> <y>9930.269531</y> </Measurement> <Measurement> <PhotoId>158</PhotoId> <x>9079.006836000001</x> <y>9902.772461000001</y> </Measurement> <Measurement> <PhotoId>162</PhotoId> <x>6240.366211</x> <y>9896.118164</y> </Measurement> </TiePoint> </TiePoints> <!-- 可选:基于用户连接点(从 0 开始索引)的块定位约束;每个约束可选。 --> <PositioningConstraints> <OriginConstraint> <O>2</O> </OriginConstraint> <ScaleConstraint> <A>0</A> <B>3</B> <DistanceAB>56.350</DistanceAB> </ScaleConstraint> <AxisConstraint> <A>0</A> <B>3</B> <!-- x、y 或 z --> <AxisAB>z</AxisAB> </AxisConstraint> <OrientationConstraint> <A>0</A> <B>3</B> <C>2</C> <!-- x、y 或 z --> <AxisAB>z</AxisAB> <!-- lowerX、upperX、lowerY、upperY、lowerZ 或 upperZ --> <AxisSideC>upperX</AxisSideC> </OrientationConstraint> </PositioningConstraints> <PointClouds> <PointCloud> <Name>PointCloud name</Name> <Description>Description of the pointcloud</Description> <!-- POD 点云文件的绝对或相对路径。 --> <Path>PointCloud.pod</Path> <CreatedDateTime>2017-05-26T15:59:08</CreatedDateTime> <!-- SRS 定义,可为空。 --> <SRS></SRS> <BoundingBox> <XMin></XMin> <XMax></XMax> <YMin></YMin> <YMax></YMax> <ZMin></ZMin> <ZMax></ZMax> </BoundingBox> <MinResolution>0.0232077879728498</MinResolution> <MedResolution>0.0480807854162596</MedResolution> <MeanResolution>0.0779783209951879</MeanResolution> <MaxResolution>4.71837838822922</MaxResolution> <!-- UseIntensity 或 UseColor 或 None --> <ColorMode></ColorMode> <Scans> <Scan> <Name>Scan name</Name> <NumPoints>320519</NumPoints> <Attributes>2</Attributes> <!-- 若为静态扫描。 --> <SourcePosition> <x>0.05</x> <y>18.59</y> <z>58.369</z> </SourcePosition> <!-- 若为移动扫描,可提供轨迹。 --> <Trajectories> <Trajectory> <Point> <x>0.05</x> <y>18.59</y> <z>58.369</z> </Point> <!-- 可继续添加更多轨迹点。 --> </Trajectory> </Trajectories> </Scan> </Scans> </PointCloud> </PointClouds> </Block> </BlocksExchange>

本文作者:Zerol Acqua

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!