autonomousvision / unimatch

[TPAMI'23] Unifying Flow, Stereo and Depth Estimation
https://haofeixu.github.io/unimatch/
MIT License
980 stars 102 forks source link

视差图 #59

Closed dragonerpai closed 2 weeks ago

dragonerpai commented 1 month ago

你好 您的代码非常的有用,但是我想请问一下,视差图怎么不归一化啊,我想得到视差图的远黑白数值,而且我要用到视差通常会大于255,如果你能告诉我该怎么做我会非常的高兴。似乎是要改 visualization。py的这个代码是吗

disp_vis = (disp - disp.min()) / (disp.max() - disp.min()) * 255.0
disp_vis = disp_vis.astype("uint8")
disp_vis = cv2.applyColorMap(disp_vis, cv2.COLORMAP_INFERNO)
haofeixu commented 1 month ago

Hi you can save the predicted disparity as .pfm file: https://github.com/autonomousvision/unimatch/blob/master/evaluate_stereo.py#L822 and read the .pfm file with https://github.com/autonomousvision/unimatch/blob/master/utils/file_io.py#L60