GeneratePlyFile

从DEM和彩色图像生成3D PLY文件。

描述

该应用程序将包含高程的图像转换为PLY文件,这是一种存储3D模型的文件格式。此格式适用于在MeshLab等软件上进行可视化 [2] 或云比较 [3]

这个应用程序是立体重建框架的一部分。输入数据可以由应用程序产生 DisparityMapToElevationMap

支持的输入图像有两种类型:

  • 带有地面投影的DEM图像,包含高程值。可以将每个高程值视为一个三维点。
  • 3D网格图像,包含5个波段(前3个是每个点的3D坐标,第5个是有效值大于或等于1的有效性遮罩)

用户还应提供包含每个三维点的颜色值的支持图像。颜色值将嵌入到PLY文件中。

参数

The input DEM image -indem image Mandatory
The image should be either a projected DEM or a 3D grid containing 3D point coordinates and a validity mask.

Conversion Mode -mode [dem|3dgrid] Default value: dem

  • DEM
    DEM conversion mode (the projection information of the DEM is used to derive the X and Y coordinates of each point)
  • 3D grid
    3D grid conversion mode

Map Projection -map [utm|lambert2|lambert93|wgs|epsg] Default value: utm
Defines the map projection to be used.

  • Universal Trans-Mercator (UTM)
    A system of transverse mercator projections dividing the surface of Earth between 80S and 84N latitude.
  • Lambert II Etendu
    This is a Lambert Conformal Conic projection mainly used in France.
  • Lambert93
    This is a Lambert 93 projection mainly used in France.
  • WGS 84
    This is a Geographical projection
  • EPSG Code
    This code is a generic way of identifying map projections, and allows specifying a large amount of them. See www.spatialreference.org to find which EPSG code is associated to your projection;

通用跨墨卡托(UTM)选项

Zone number -map.utm.zone int Default value: 31
The zone number ranges from 1 to 60 and allows defining the transverse mercator projection (along with the hemisphere)

Northern Hemisphere -map.utm.northhem bool Default value: false
The transverse mercator projections are defined by their zone number as well as the hemisphere. Activate this parameter if your image is in the northern hemisphere.

EPSG代码选项

EPSG Code -map.epsg.code int Default value: 4326
See www.spatialreference.org to find which EPSG code is associated to your projection


The input color image -incolor image Mandatory
If the color image has 4 bands it will be interpreted as Red, Green, Blue, NIR. In other cases, only the first one is used (gray scale colors). The color values are expected in the range 0 - 255, and will be embedded with each 3D point of the PLY file.

The output Ply file -out filename [dtype] Mandatory
The output Ply file will contain as many 3D points as pixels in the input DEM.

实例

从命令行执行以下操作:

otbcli_GeneratePlyFile -indem image_dem.tif -out out.ply -incolor image_color.tif

来自Python的评论:

import otbApplication

app = otbApplication.Registry.CreateApplication("GeneratePlyFile")

app.SetParameterString("indem", "image_dem.tif")
app.SetParameterString("out", "out.ply")
app.SetParameterString("incolor", "image_color.tif")

app.ExecuteAndWriteOutput()

局限性

输入的DEM图像必须完全存储在内存中。