用python生成无人机影像的正射影像、数字高程模型以及三维建模 |
您所在的位置:网站首页 › 航拍图片生成模型软件叫什么 › 用python生成无人机影像的正射影像、数字高程模型以及三维建模 |
OpenDroneMap
OpenDroneMap 是一个开源的航拍图像处理工具,可以把航拍图像进行点云、正射影像和高程模型等处理,也可以做3维重构,生成3维模型。简直是个神器,做出来的效果和pix4d等软件差不多(我目前只做了无人机影像的正摄影像的生成)。 根据官方文档所说,PyODM可以很轻易的创建无人机影像的正射图,DEM,3d模型以及点云。 正射图的效果如下: 用pip安装即可。 pip install -U pyodm 启动dockerpyodm需要启动docker,所以在使用之前还需要先安装docker. windows的安装就不说了,可以自行百度,下面介绍linux系统下docker的安装。 # 安装docker $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo apt-get install -y docker-ce # 启动docker,这里会自己下载需要的包,所以需要等待一会儿。 $ sudo docker run -ti -p 3000:3000 opendronemap/nodeodm 2.python教程大致流程是这样,先连接Node,然后新建任务,然后等待任务执行完成,最后获取结果。 这里关键是新建任务时有个option选项,可以设置一些配置。看文档说明得知,配置会影响处理速度与结果的质量。 对正射影像的制作来说,需要配置的一些参数(参数可以在官方文档查看)如下: orthophoto-resolution:米/像素,表示地面分辨率dsm:是否要生成dsm,如果不需要的话,选false会加快处理速度ignore-gsd:设置为True就会跳过一些加速处理,得到的图像质量会好一些min-num-features:找的特征点数量,数量越多质量越好,处理时间越长texturing-nadir-weight:官方建议,在都市设为29-32,草地或者平底设置为0-6mesh-octree-depth:官方建议设置为10-11,增加建筑屋顶的平滑性。注意:在制作正射影像时,选择的图片最好是有至少两个轨道的数据,一个航线的数据拼接会失败,即task.wait_for_completion()会返回failed. import os from pyodm import Node import time from tqdm import tqdm image_dir = 'testdata/' result_path = image_dir.split('/')[0]+'_results' ip = 'xxx.xx.xx.xx' # 改为自己的ip port = 3000 start = time.time() images_name = os.listdir(image_dir) images_name = [image_dir+image_name for image_name in images_name] print(images_name) n = Node(ip, port) print("Node连接成功,{}张图开始处理".format(len(images_name))) task = n.create_task(images_name, {'orthophoto-resolution': 0.0274,"min-num-features":35000}) print("任务创建完成") pbar = tqdm(total=100) processing = 0 while True: info = task.info() if info.progress==100: break pbar.update(info.progress-processing) processing = info.progress if info.last_error!='': print("error ", info.last_error) time.sleep(0.1) pbar.close() print("处理完成") # task.wait_for_completion() task.download_assets(result_path) print("{}张图消耗{}秒".format(len(images_name), time.time() - start)) 3.其它查看官方文档可能需要科学上网,所以把option列出来了。 -h, --help show this help message and exit --images , -i Path to input images --project-path Path to the project folder --resize-to resizes images by the largest side for opensfm. Set to -1 to disable. Default: 2048 --end-with , -e Can be one of:dataset | split | merge | opensfm | mve | odm_filterpoints | odm_meshing | mvs_texturing | odm_georeferencing | odm_dem | odm_orthophoto --rerun , -r Can be one of:dataset | split | merge | opensfm | mve | odm_filterpoints | odm_meshing | mvs_texturing | odm_georeferencing | odm_dem | odm_orthophoto --rerun-all force rerun of all tasks --rerun-from Can be one of:dataset | split | merge | opensfm | mve | odm_filterpoints | odm_meshing | mvs_texturing | odm_georeferencing | odm_dem | odm_orthophoto --proj Projection used to transform the model into geographic coordinates --min-num-features Minimum number of features to extract per image. More features leads to better results but slower execution. Default: 8000 --matcher-neighbors Number of nearest images to pre-match based on GPS exif data. Set to 0 to skip pre-matching. Neighbors works together with Distance parameter, set both to 0 to not use pre-matching. OpenSFM uses both parameters at the same time, Bundler uses only one which has value, prefering the Neighbors parameter. Default: 8 --matcher-distance Distance threshold in meters to find pre-matching images based on GPS exif data. Set both matcher- neighbors and this to 0 to skip pre-matching. Default: 0 --use-fixed-camera-params Turn off camera parameter optimization during bundler Off by default unless --camera parameter used --camera-lens Can be one of auto | perspective | brown | fisheye | spherical Set a camera projection type. Manually setting a value can help improve geometric undistortion. By default the application tries to determine a lens type from the images metadata. Default: auto --max-concurrency The maximum number of processes to use in various processes. Peak memory requirement is ~1GB per thread and 2 megapixel image resolution. Default: number of cores --depthmap-resolution Controls the density of the point cloud by setting the resolution of the depthmap images. Higher values take longer to compute and more memory but produce denser point clouds. Default: 640 --opensfm-depthmap-min-consistent-views |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |