opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

Kinfu class has a different behavior between OpenCV 4.2.0 and OpenCV 4.5.3

Open carlos-martinez opened this issue 4 years ago • 5 comments

System information (version)
  • OpenCV => 4.5.3
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2019
Detailed description

Hi, I am trying to upgrade my code from 4.2.0 to 4.5.3.

In our current 4.2 version, we modified the kinfu::Params to accommodate our needs. However, using the same settings in the 4.5.3 version generates a model with more noise and less information on the vertical walls.

Model created with ver 4.2.0

image

Model created with ver 4.5.3

image

For my test, I used the same set of images as input data, and both models end with ~1.2 million points.

Are there any changes on the parameters that we need to modify or adapt? Thanks

Carlos

carlos-martinez avatar Oct 18 '21 13:10 carlos-martinez

Hi, do you kown how to save as 3D Mesh using Kinfu_demo? I can run Kinfu_demo, but I do not kown how to save uMat as point define as uMat. Can you give me a help.Thanks! image

zhuisa avatar Dec 11 '21 19:12 zhuisa

Hi, do you kown how to save as 3D Mesh using Kinfu_demo? I can run Kinfu_demo, but I do not kown how to save uMat as point define as uMat. Can you give me a help.Thanks! image

Hello, I got an unexpected error when I run with the simple code Ptr<Params> params = Params::defaultParams(); and the error comes undefined reference to cv::kinfu::Params::defaultParams()'`. Do you have any idea why this error appears or could you please post your Kinfu_demo? Thanks a lot!

Impuuuuuu avatar Dec 15 '21 12:12 Impuuuuuu

Hi, do you kown how to save as 3D Mesh using Kinfu_demo? I can run Kinfu_demo, but I do not kown how to save uMat as point define as uMat. Can you give me a help.Thanks! image

I have not tried to save the UMat; in my current implementation flow, I save the frames from the camera as binary data (cv::Mat) and then copy to Umat in order to generate the 3D Model. The code for saving/loading a cv::Mat as is here: https://github.com/takmin/BinaryCvMat/blob/master/BinaryCvMat.cpp

When the 3D model is calculated, I am using pcl to generate a PointCloud and then save the information. I am sure this could be implemented in any other platform you might be using:

` // Gets a point cloud with the points and normals void GetPointCloud(Mat& points, Mat& normals, pcl::PointCloudpcl::PointNormal& cloud)

{ // Convert data into PCL types in order to be saved for (int i = 0; i < points.rows; ++i) { pcl::Normal n; pcl::PointNormal point; point.x = points.at(i, 0); point.y = points.at(i, 1); point.z = points.at(i, 2); point.normal_x = normals.at(i, 0); point.normal_y = normals.at(i, 1); point.normal_z = normals.at(i, 2); cloud.push_back(point); } } `

Hope this helps

Carlos

carlos-martinez avatar Dec 15 '21 16:12 carlos-martinez

I am using the code provided in the opencv_contrib:

https://github.com/opencv/opencv_contrib/blob/4.x/modules/rgbd/samples/kinfu_demo.cpp https://github.com/opencv/opencv_contrib/blob/4.x/modules/rgbd/samples/colored_kinfu_demo.cpp

BR.Carlos

carlos-martinez avatar Dec 15 '21 16:12 carlos-martinez

I am using the code provided in the opencv_contrib:

https://github.com/opencv/opencv_contrib/blob/4.x/modules/rgbd/samples/kinfu_demo.cpp https://github.com/opencv/opencv_contrib/blob/4.x/modules/rgbd/samples/colored_kinfu_demo.cpp

BR.Carlos

Got it, thanks!

Impuuuuuu avatar Dec 16 '21 07:12 Impuuuuuu