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)
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)
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)
def ortho_digital_globe_image(): print("STARTING A DIGITAL GLOBE DEMO") nx = 1000 ny = 1000 extent = ortho_tools.get_extent(digital_globe_image) orthod_image = ortho_tools.create_ortho_gtiff_image_world_to_sensor(digital_globe_image, nx, ny, extent) save_fname = os.path.join(save_dir, "dg_image_ortho_15AUG31100732-M2AS-056082094030_01_P001.tif") orthod_image.write_to_disk(save_fname) logging.debug("created ortho from digital globe view ready stereo image.") print("ortho image located at: " + save_fname)