示例#1
0
def ortho_micasense_to_dem_4326():
    extent_4326 = photogrammetry_utils.reproject_geometry(extent_native, dem_native_projection, crs_defs.PROJ_4326)
    ortho_nx, ortho_ny = photogrammetry_utils.get_nx_ny_pixels_in_extent(extent_4326, gsd_lon, gsd_lat)
    print("making ortho of size: " + str(ortho_nx) + "x" + str(ortho_ny))

    output_fullpath = os.path.join(save_dir, "micasense_ortho_w_dem_4326.tif")
    ortho_tools.create_ortho_gtiff_image_world_to_sensor(micasense_image, ortho_nx, ortho_ny, extent_4326,
                                                         world_proj=crs_defs.PROJ_4326, dem=dem_image, nodata_val=0,
                                                         output_fname=output_fullpath)
    print("wrote orthorectified micasense image to " + output_fullpath)
示例#2
0
def ortho_micasense_to_dem_native():
    output_fullpath = os.path.join(save_dir, "micasense_ortho_w_dem_native.tif")

    ortho_nx, ortho_ny = photogrammetry_utils.get_nx_ny_pixels_in_extent(extent_native, gsd_m, gsd_m)
    print("making ortho of size: " + str(ortho_nx) + "x" + str(ortho_ny))
    ortho_tools.create_ortho_gtiff_image_world_to_sensor(micasense_image, ortho_nx, ortho_ny, extent_native,
                                                         world_proj=dem_image.get_projection(),
                                                         dem=dem_image, nodata_val=0,
                                                         output_fname=output_fullpath)
    print("wrote orthorectified micasense image to " + output_fullpath)
示例#3
0
def ortho_micasense_to_flat_earth_native():
    elevation = np.nanmean(dem_image.dem_data)
    const_elevation_dem = DemFactory.constant_elevation(elevation)

    ortho_nx, ortho_ny = photogrammetry_utils.get_nx_ny_pixels_in_extent(extent_native, gsd_m, gsd_m)
    print("making ortho of size: " + str(ortho_nx) + "x" + str(ortho_ny))

    output_fullpath = os.path.join(save_dir, "micasense_ortho_w_const_elevation_dem_native.tif")

    ortho_tools.create_ortho_gtiff_image_world_to_sensor(micasense_image, ortho_nx, ortho_ny, extent_native,
                                                         world_proj=dem_image.get_projection(),
                                                         dem=const_elevation_dem, nodata_val=0,
                                                         output_fname=output_fullpath)
    print("wrote orthorectified micasense image to " + output_fullpath)