vye16 / shape-of-motion

MIT License
802 stars 58 forks source link

cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'remap' #26

Open phongnhhn92 opened 3 months ago

phongnhhn92 commented 3 months ago

Hi, I have this error when I tried running your code on the pre-processed iphone dataset:

(som) ubuntu@6c82abd23c18:~/Code/shape-of-motion$ CUDA_VISIBLE_DEVICES=7 PYTHONPATH='.' python scripts/evaluate_iphone.py --data_dir ./data/paper-windmill --result_dir ./output --seq_names paper-windmill
=========================================
Evaluating paper-windmill
=========================================
Loading val covisibles: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 419/419 [00:01<00:00, 218.83it/s]
> /home/ubuntu/Code/shape-of-motion/scripts/evaluate_iphone.py(103)load_data_dict()
-> cv2.remap(
(Pdb) type(depth)
<class 'numpy.ndarray'>
(Pdb) cv2.remap(depth,kps_2d[None, :, :2].astype(np.float32),None,cv2.INTER_LINEAR,borderMode=cv2.BORDER_CONSTANT,)[0]
*** cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'remap'
> Overload resolution failed:
>  - src is not a numpy array, neither a scalar
>  - Expected Ptr<cv::UMat> for argument 'src'