Skip to content

Commit

Permalink
add remaining corrections, full worklfow runs now :D
Browse files Browse the repository at this point in the history
  • Loading branch information
ShashankBice committed Apr 28, 2022
1 parent ef17c24 commit dc867df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion scripts/skysat_triplet_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ def main():
camera_list = sorted(glob.glob(os.path.join(init_ba,'run-run-*.tsai')))
print(f"Detected {len(camera_list)} cameras to be registered to DEM")
alignment_vector = glob.glob(os.path.join(alignment_dir,'alignment_vector.txt'))[0]
if not os.path.exists(aligned_cam_dir):
os.makedirs(aligned_cam_dir)
print("Aligning cameras")
workflow.align_cameras_wrapper(input_camera_list=camera_list,transform_txt=alignment_vector,
outfolder=aligned_cam_dir)
Expand All @@ -306,7 +308,7 @@ def main():
workflow.execute_skysat_orhtorectification(images=img_list,data='triplet',session=final_ortho_session,
outdir=final_ortho_dir,tsrs=epsg_code,dem=georegistered_median_dem,
ba_prefix=os.path.join(aligned_cam_dir,'run-run'),mode='science',
overlap_list=None,copy_rpc=0,orthomosaic=1)
overlap_list=overlap_stereo_txt,copy_rpc=0,orthomosaic=1)

if 10 in steps2run:
# this produces a final plot of orthoimage,DEM, NMAD and countmaps
Expand Down
7 changes: 4 additions & 3 deletions skysat_stereo/skysat_stereo_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ def gridding_wrapper(pc_list,tr,tsrs=None):


def alignment_wrapper_single(ref_dem,source_dem,max_displacement,outprefix,
align,trans_only=0,initial_align=None):
align='point-to-plane',trans_only=0,initial_align=None):
if trans_only == 0:
trans_only = False
else:
trans_only = True
asp.dem_align(ref_dem,source_dem,max_displacement,outprefix,align,
trans_only,threads=iolib.cpu_count(),intial_align=initial_align)
trans_only,threads=iolib.cpu_count(),initial_align=initial_align)

def alignment_wrapper_multi(ref_dem,source_dem_list,max_displacement,align,initial_align=None,
def alignment_wrapper_multi(ref_dem,source_dem_list,max_displacement,align='point-to-plane',initial_align=None,
trans_only=0):
from p_tqdm import p_umap
outprefix_list=['{}_aligned_to{}'.format(os.path.splitext(source_dem)[0],os.path.splitext(os.path.basename(ref_dem))[0]) for source_dem in source_dem_list]
Expand Down Expand Up @@ -481,6 +481,7 @@ def align_cameras_wrapper(input_camera_list,transform_txt,outfolder,rpc=0,dem='N


def dem_mosaic_wrapper(dir,mode='triplet',out_folder=None,identifier=None,tile_size=None,filter_dem=1,min_video_count=2,max_video_nmad=5):
from p_tqdm import p_map
if out_folder is None:
out_folder = os.path.join(dir,'composite_dems')

Expand Down

0 comments on commit dc867df

Please sign in to comment.