Closed pyni closed 4 years ago
It seems correct with the visualizing code as follows:
189 ¦ ¦ from cv2 import imshow, waitKey
190 ¦ ¦ imshow("bgr", bgr.astype("uint8"))
191 ¦ ¦ show_zbuf = zbuf.copy()
192 ¦ ¦ min_d, max_d = show_zbuf[show_zbuf > 0].min(), show_zbuf.max()
193 ¦ ¦ show_zbuf[show_zbuf>0] = (show_zbuf[show_zbuf>0] - min_d) / (max_d - min_d) * 255
194 ¦ ¦ show_zbuf = show_zbuf.astype(np.uint8)
195 ¦ ¦ imshow("dpt", show_zbuf)
196
197 ¦ ¦ show_msk = (msk / msk.max() * 255).astype("uint8")
198 ¦ ¦ imshow("msk", show_msk)
199 ¦ ¦ waitKey(0)
but i think msk = (zbuf>-1e8).astype('uint8') should be changed into: msk = (zbuf>0).astype('uint8') Otherwise, the result is shown as follows:
You're right, I forgot to update rgbd_renderer.py
after updating rastertriangle_so.cpp
. That line of code have been revised to msk = (zbuf>1e-8).astype('uint8')
in the newest commit. I think >1e-8
is a better choice compared to >0
in float type data. Thanks for your contribution.
What a quick reply! You are welcome.
Hi, i found there maybe a error in your code. I think -1e8 should be 0. Otherwise, the mask may be all white.