for u in u_list: grid_list.append([u, v]) #print 'grid_list:', grid_list image.distorted_uv = proj.redistort(grid_list, optimized=True) image_node = smart.smart_node.getChild(image.name, True) surface_m = image_node.getFloat("tri_surface_m") if surface_m < 0.1: surface_m = image_node.getFloat("srtm_surface_m") yaw_error_deg = image_node.getFloat("yaw_error") image.set_aircraft_yaw_error_estimate(yaw_error_deg) proj_list = project.projectVectors(IK, image.get_body2ned(), image.get_cam2body(), grid_list) ned, ypr, quat = image.get_camera_pose() pts_ned = project.intersectVectorsWithGroundPlane(ned, surface_m, proj_list) #print(image.name, "pts_3d (ned):\n", pts_ned) # convert ned to xyz and stash the result for each image image.grid_list = [] for p in pts_ned: image.grid_list.append([p[1], p[0], -p[2]]) # generate the panda3d egg models dir_node = getNode('/config/directories', True) img_src_dir = dir_node.getString('images_source') panda3d.generate_from_grid(proj, name_list, src_dir=img_src_dir, analysis_dir=proj.analysis_dir, resolution=args.texture_resolution)
else: #print(image.get_body2ned(opt=True)) proj_list = project.projectVectors( IK, image.get_body2ned(opt=True), image.get_cam2body(), grid_list ) #print 'proj_list:', proj_list if args.direct: ned, ypr, quat = image.get_camera_pose() else: ned, ypr, quat = image.get_camera_pose(opt=True) #print('cam orig:', image.camera_pose['ned'], 'optimized:', ned) if args.ground: pts_ned = project.intersectVectorsWithGroundPlane(ned, args.ground, proj_list) elif args.srtm: pts_ned = srtm.interpolate_vectors(ned, proj_list) else: # intersect with our polygon surface approximation pts_ned = intersect_vectors(ned, proj_list, -image.z_avg) #print(image.name, "pts_3d (ned):\n", pts_ned) # convert ned to xyz and stash the result for each image image.grid_list = [] for p in pts_ned: image.fit_xy.append([p[1], p[0]]) image.fit_z.append(-p[2]) image.fit_edge.append(True)
proj_list = project.projectVectors(IK, image.get_body2ned(), image.get_cam2body(), grid_list) else: #print(image.get_body2ned(opt=True)) proj_list = project.projectVectors(IK, image.get_body2ned(opt=True), image.get_cam2body(), grid_list) #print 'proj_list:', proj_list if args.direct: ned, ypr, quat = image.get_camera_pose() else: ned, ypr, quat = image.get_camera_pose(opt=True) #print('cam orig:', image.camera_pose['ned'], 'optimized:', ned) if args.ground: pts_ned = project.intersectVectorsWithGroundPlane( ned, args.ground, proj_list) if args.median: pts_ned = project.intersectVectorsWithGroundPlane( ned, median, proj_list) elif args.srtm: pts_ned = srtm.interpolate_vectors(ned, proj_list) elif False: # this never seemed that productive print(image.name, image.z_avg) pts_ned = project.intersectVectorsWithGroundPlane( ned, image.z_avg, proj_list) elif True: # intersect with our polygon surface approximation pts_ned = intersect_vectors(ned, proj_list, -image.z_avg) elif False: # (moving away from the binned surface approach in this