meiqua / pose_refine

cuda icp for 6D pose estimation
BSD 2-Clause "Simplified" License
97 stars 25 forks source link

Wrong Result When Render With ROI #5

Closed euivmar closed 5 years ago

euivmar commented 5 years ago

First of all, thank you for your code!

I have tried the renderer_test (test.cpp) changing the ROI as follows : cuda_renderer::Model::ROI roi = {320, 240, 100, 100};

And it give me the following result 2019-10-15 17_25_01-gpu_depth_roi

When it should be: 2019-10-15 17_24_26-gpu_depth

Any clue why it is not working properly?

A second point I would like to raise relates about timing. The GPU ICP performance it's very impressive, good job! however this code:

device_vector_holder<::Vec3f> pcd_buffer_cuda, normal_buffer_cuda; scene.init_Scene_projective_cuda(scene_depth, K_, pcd_buffer_cuda, normal_buffer_cuda);

is about ten times slower than the ICP, why is it so slow? do you have any advice for improving its perfomance? Obviously, using a ROI will help and that's why it is so important that works properly the render with a ROI.

Thank you!

meiqua commented 5 years ago

Oops, buffer idx here is wrong, it should be

            size_t x_to_write = (P[0] - roi.x);

Same for cuda side

It's much slower because the initial parts are totally on cpu. You can rewrite it (mainly normals) if caring about the speed.

euivmar commented 5 years ago

Thank you for your quick reply! now it works well.