xy_ref=np.mgrid[:img_wh[1],:img_wh[0]][::-1].astype(np.float32)xy_src=xy_ref2src(xy_ref,depth_ref,P_world2ref,depth_src,P_world2src,img_wh)# Sample the depth of xy_src using bilinear interpolationdepth_src2ref=cv2.remap(depth_src,xy_src[0].astype(np.float32),xy_src[1].astype(np.float32),interpolation=cv2.INTER_LINEAR)
resize
(2024-03-14)
1
2
3
4
5
6
7
8
9
10
img_ref=cv2.imread(os.path.join(root_dir,# channel is BGRf'Rectified/{scan}/rect_{vid+1:03d}_3_r5000.png'))# scale to specified sizeimg_ref=cv2.resize(img_ref,tuple(args.img_wh),interpolation=cv2.INTER_LINEAR)[:,:,::-1]# to RGB# scaling with factor, h and w both increase 4 timesproba_ref=cv2.resize(proba_ref,None,fx=4,fy=4,interpolation=cv2.INTER_LINEAR)