MegaDepth icon indicating copy to clipboard operation
MegaDepth copied to clipboard

How did you extract Make3D depthmaps from the dataset?

Open Neltherion opened this issue 6 years ago • 4 comments

Hi, First of all, thanks for the Paper & the Code.

The Make3D Dataset Has Two Parts : Images + Depths

The Depth part of the dataset is described by the ReadMe as :

Laser Range data with Ray PositionData Format: Position3DGrid (55x305x4)

Position3DGrid(:,:,1) is Vertical axis in meters (Y)

Position3DGrid(:,:,2) is Horizontal axis in meters (X)

Position3DGrid(:,:,3) is Projective Depths in meters (Z)

Position3DGrid(:,:,4) is Depths in meters (d)

The Images are in the shape of (2272, 1704, 3) BUT the Depths are in the shape of (55, 305, 4). By the way of its structure and ratios, one can tell that the Depth Data is not an image (55 x 305 != 2272 x 1704).

So then, how were you able to extract the depth maps? is there a code or a procedure which I've missed?

Thanks

Neltherion avatar Dec 16 '18 08:12 Neltherion

have you known now?

ylhua avatar Feb 21 '19 01:02 ylhua

不知道您的问题是否解决?我现在需要make3D数据集的真实深度图用以训练我的模型,但是官方提供的是.mat文件,尝试转换为图片格式后效果极差,或许向您说的根本无法转化为图像,也可能是我的转换方法不对?感谢您的指导!

zwtpro-nb-puls avatar Jan 05 '21 07:01 zwtpro-nb-puls

I write a python code, which works

import cv2 import scipy.io as scio from PIL import Image import numpy as np import matplotlib.pyplot as plt import os

array_struct = scio.loadmat('/home/1.mat') #print(array_struct.keys()) data=array_struct['Position3DGrid'] #print(data.shape) image = data[:,:,3] image = image/80

resized_img = cv2.resize(image,(1704,2272)) plt.imsave(os.path.join("./", "1.jpg"), resized_img, cmap='rainbow')

baoguoma avatar Mar 14 '21 02:03 baoguoma

@kebinpeng thanks but This does not work, the depth map I get after running this code is completely false, is there any other way to extract the depth map from Make3D dataset??

saqibnaziir avatar Oct 19 '21 14:10 saqibnaziir