j96w/DenseFusion

3d bbox

Closed this issue · 9 comments

Hello,
There are many 3d bboxes in the figures of this paper. Could you tell me how to draw the 3d bbox with output of this network(R and T)?
thanks for help !
@j96w

j96w commented

First, generate 8 corner points of the bbox from the mesh. The distance between the two points with the minimum and maximum coordinates is the longest possible diagonal for the box, and the points can be thought of as the upper right corner in the front of the box, and the lower left corner in the back. Then, rotate and translate the 8 points with R,T and do projection to get the 3d bbox in 2d frame.

ok, thanks for your help ! I will have a try

hi @iris0329 , did you figured out how to draw the 3d bbox , especially for linemod data :
I'm working on it , but i'm stack with it , if you have done some progress on it , could you give some more details please .

thank you for help !
thank's @j96w

@hamza-04 I figured it out as what j96w said on linemod data. But several weeks passed, I maybe forget something.
First, you need to find the 8 corner points of the model such as the yellow duck or something.
and rotate this 8 points as the author did when rotating the model. (perhaps you could read the code carefully to find out how to rotate and translate the model, same as rotating 8 corner points)
project these 8 points into 2d image, and then connect the points into lines. so you could get the final bbox.


like this:
image

Hope I could help you.

hi @j96w, i have draw the 3d boxes accurately on the linemod datasets, but when i use the same way on ycb datasets, the box is not such accurately (as show below), can you give me some suggest ? thank you for you reply!

图片

@lzrrr33 have you applied the transformation on the bbox before projecting into 2D?
You can have a look on an here

@towardthesea thank you for you reply! but sorry,i dont understand the transformation you say mean. My process is as follows:

  1. get the my_r , my_t after refine network and the object corners
  2. by quaternion_matrix(my_r)[0:3, 0:3] transform my_r to get Rotation matrix my_mat
  3. by np.dot(corners, my_mat.T)+my_t to get the 3d bbox
  4. projecting into 2D
    Which step went wrong?

@lzrrr33 your process is what I mean for transformation. Steps look fine for me. Maybe you should check some other preprocessing steps like segmentation or intrinsic parameters of the camera (if you use a different one than the Asus used for the dataset)

@lzrrr33 your process is what I mean for transformation. Steps look fine for me. Maybe you should check some other preprocessing steps like segmentation or intrinsic parameters of the camera (if you use a different one than the Asus used for the dataset)

2021-03-30 10-07-38 的屏幕截图

Sorry to disturb you, I use your script to test my self-made model, but the bounding box is not the same as expected. At the same time, It said "Not pass! Lost detection!" when i eval. Can you give me some suggestions