Open TWJianNuo opened 4 years ago
Hello! I'm glad you are able to utilize the dataset. I have graduated from my master's and am very busy working at a startup. Feel free to create a PR with any changes you think could improve the repo!
Hi,
I also encountered weird artifact in the conversion provided in vis_presil.py between raw depth data and the actual depth in meters. The artifact seems to be radial, so I tried to change
d_nc = math.sqrt(pow(nc_x,2) + pow(nc_y,2) + pow(nc_z,2))
to
d_nc = nc_z
In the function ndcToDepth.
The radial artifact seems to disappear but I'm not sure that the results are actual depth in meters. Does someone know?
I think the code is mostly correct, it just misses the conversion from degrees to radians on line 26 for math.tan
. Also the code is very inefficient because of the for loops. I wrote a better version:
def ndc2real(depth_ndc):
# depth_ndc: (1080, 1920) float32
h, w = depth_ndc.shape
nc_z = 0.15
fc_z = 600
fov_v = 59 #degrees
nc_h = 2 * nc_z * np.tan(np.radians(fov_v / 2.0))
nc_w = w / h * nc_h
nc_x, nc_y = np.mgrid[:h, :w][::-1].astype(np.float32)
nc_x = (nc_x / (w - 1) * 2 - 1) * nc_w / 2
nc_y = (nc_y / (h - 1) * 2 - 1) * nc_h / 2
d_nc = np.sqrt(nc_x ** 2 + nc_y ** 2 + nc_z ** 2)
depth_real = d_nc / (depth_ndc + (nc_z * d_nc / (2 * fc_z)))
return depth_real
and the depth looks correct
Hi, I used your publised data but find several problems. Listed below:
It is a great work but with some improvment it will be recognized and utilized better, thanks!