ethnhe / raster_triangle

A simple renderer with z-buffer for synthesis data generating.
56 stars 22 forks source link

This is one of the .pkl files I generated. Both mask and depth are zero. How can I get depth and mask images? #10

Closed Aristkj closed 3 years ago

Aristkj commented 3 years ago

This is one of the .pkl files I generated. Both mask and depth are zero. How can I get depth and mask images? Looking forward for your reply, thank you.

{'rgb': array([[[ 15, 6, 23], [ 15, 6, 23], [ 15, 6, 23], ..., [ 4, 0, 14], [ 5, 1, 15], [ 5, 1, 15]],

   [[ 15,   6,  23],
    [ 15,   6,  23],
    [ 15,   6,  23],
    ...,
    [  4,   1,  14],
    [  5,   1,  15],
    [  5,   1,  15]],

   [[ 15,   6,  23],
    [ 15,   6,  23],
    [ 15,   6,  23],
    ...,
    [  5,   1,  15],
    [  5,   1,  15],
    [  5,   1,  15]],

   ...,

   [[155,  97,  78],
    [159, 101,  82],
    [175, 116,  96],
    ...,
    [ 41,  46, 104],
    [ 38,  44, 103],
    [ 38,  43, 103]],

   [[128,  73,  56],
    [133,  78,  60],
    [151,  95,  77],
    ...,
    [ 34,  37,  93],
    [ 34,  38,  95],
    [ 35,  38,  95]],

   [[113,  60,  44],
    [118,  65,  48],
    [138,  83,  66],
    ...,
    [ 30,  32,  86],
    [ 32,  35,  90],
    [ 33,  36,  91]]], dtype=uint8), 'mask': array([[0, 0, 0, ..., 0, 0, 0],
   [0, 0, 0, ..., 0, 0, 0],
   [0, 0, 0, ..., 0, 0, 0],
   ...,
   [0, 0, 0, ..., 0, 0, 0],
   [0, 0, 0, ..., 0, 0, 0],
   [0, 0, 0, ..., 0, 0, 0]], dtype=uint8), 'depth': array([[0., 0., 0., ..., 0., 0., 0.],
   [0., 0., 0., ..., 0., 0., 0.],
   [0., 0., 0., ..., 0., 0., 0.],
   ...,
   [0., 0., 0., ..., 0., 0., 0.],
   [0., 0., 0., ..., 0., 0., 0.],
   [0., 0., 0., ..., 0., 0., 0.]], dtype=float32), 'K': array([[572.4114 ,   0.     , 325.2611 ],
   [  0.     , 573.57043, 242.04899],
   [  0.     ,   0.     ,   1.     ]]), 'RT': array([[ 0.97855902, -0.19968501,  0.0504875 ,  0.01487457],
   [-0.0121214 , -0.30052999, -0.953695  ,  0.11182408],
   [ 0.20561101,  0.93263501, -0.296507  ,  0.84415561]]), 'cls_typ': 'ape', 'rnd_typ': 'fuse', 'begins': [[0, 0], [5, -112], [3, -146], [-124, 217], [-137, 305], [65, 179], [-129, -254], [253, -176], [181, 215], [116, 56], [81, 71], [-36, -154], [120, -162]]}
yongyu1996 commented 3 years ago

same question for me !

yongyu1996 commented 3 years ago

Does anyone know how to solve this problem?

ethnhe commented 3 years ago

First, check that the vertexes of the object mesh models are in the unit meter(m). Then project the transformed vertexes on the image and visualize them to check that the setting is correct. You can use the project_p3d and draw_p2ds functions to do that.

yongyu1996 commented 3 years ago

The problem is solved, thank you,my friend.

MiriamJo commented 2 years ago

How was it solved? I visualized the keypoints and everything worked fine for me. How can I fix the problem with the empty depth map? Anyone @yongyu1996 @ethnhe @Aristkj ?