tsdf-fusion-python icon indicating copy to clipboard operation
tsdf-fusion-python copied to clipboard

How to get started with new images?

Open Codeguyross opened this issue 5 years ago • 14 comments

Hello,

If I wanted to start with fresh set of images to use this code to generate a mesh.ply file, what steps do I need to do to get the new images ready? I'm new to this area of study so any help getting going is appreciated!!

Thanks!

Codeguyross avatar Jan 09 '20 19:01 Codeguyross

Hi, the pairs of color images and depth images should be aligned. You need to caculate the camera pose for each frame. ICP may be helpful.

plutoyuxie avatar Mar 06 '20 02:03 plutoyuxie

Hi, the pairs of color images and depth images should be aligned. You need to caculate the camera pose for each frame. ICP may be helpful.

I used Kinect Fusion to align the depth images and got the camera pose form there. But when I use TSDF with the pose and depth it just doesn't work.

YJonmo avatar Apr 16 '20 00:04 YJonmo

Hi! I have my .pcd point clouds saved, and I use ICP to calculate the poses. However, running tsdf.py, the output mesh looks quite odd and elongated. Any tips would be welcome, thank you!

Viky397 avatar Jan 25 '21 18:01 Viky397

Maybe try to scale your pose info, i.e., divide it by a 2 or 3 ..

YJonmo avatar Jan 25 '21 22:01 YJonmo

Hello. I tried dividing by 2 or 3 but this just makes the output mesh look more sparse, and doesnt help with the oddly elongated output shape.

Viky397 avatar Feb 01 '21 14:02 Viky397

Did you divide the translation? Only the translation should be divided or multiplied by a scaling coefdicient. Keep in mind, the x axis is rightward, y is downward and z is outward.

YJonmo avatar Feb 01 '21 18:02 YJonmo

I used the following to get the transformation:

reg_p2p = o3d.registration.registration_icp(
            source, target, threshold, trans_init,
            o3d.registration.TransformationEstimationPointToPoint())

And then I save the following to a .txt file, and divide by a scaling factor: reg_p2p.transformation/3

Viky397 avatar Feb 04 '21 15:02 Viky397

I guess the reg_p2p.transformation is a 4*4 transformation matrix?

You only need to divide the last column of this matrix by a coefficient. The last column is a the translation: reg_p2p.transformation[0:3,-1] = reg_p2p.transformation[0:3,-1]/Coeff

In my case, I chose changes in the movement when it was no rotation. Then I focused on finding the correct dividing coefficient.

YJonmo avatar Feb 04 '21 23:02 YJonmo

Hm still seems very odd. This is the resulting mesh.ply. image

Viky397 avatar Feb 05 '21 14:02 Viky397

It is hard to say what is going on just by looking at the image. Also give some off set to your depth values. For example all the depth values should be added by some constant value. If you maximum depth is 255, then add 50 to the value of each pixel and see how it looks like. Play with the numbers.

YJonmo avatar Feb 08 '21 01:02 YJonmo

@Viky397 did you find a solution to this?

Ademord avatar Jun 18 '21 14:06 Ademord

@Ademord nope. I switched to Kimera-Semantics instead. Very easy repo to work with in ROS :)

Viky397 avatar Jun 18 '21 20:06 Viky397

@Viky397 ahhh im working in unity so i need to do this by hand technically :(

Ademord avatar Jun 18 '21 20:06 Ademord