isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.23k stars 2.28k forks source link

error: free(): invalid pointer #3162

Closed Rogers34 closed 3 years ago

Rogers34 commented 3 years ago

IMPORTANT: Please use the following template to report the bug.


Describe the bug rogers@rogers-GL65-9SD:~/nowhere/Open3D/Open3D-0.12/open3d/examples/python/reconstruction_system$ python run_system.py --make config/realsense.json Extracting frames from RGBD video file free(): invalid pointer Aborted (core dumped)

To Reproduce Steps to reproduce the behavior:

  1. cd Open3D/Open3D-0.12/open3d/examples/python/reconstruction_system
  2. python python run_system.py --make config/realsense.json
  3. See error Extracting frames from RGBD video file free(): invalid pointer Aborted (core dumped)

Expected behavior reconstruct scene use the dataset L515_test.bag

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

ssheorey commented 3 years ago

Please test with the latest code in master. The latest development wheel includes the fix.

ssheorey commented 3 years ago

Duplicate of #2837

Rogers34 commented 3 years ago

Thanks a lot for your response. I have install the *.whl in several times, howerver I cant solve the problem. At last I compile the source code, and then install the python package. The program run well finally. And then, I run the code in examples/python/reconstruction_system/run_system.py with my own bag file that I record with a Realsense D435 $ python run_system.py --make --register --refine --integrate config/realsense.json I get a strange result. It seems that the registration between fragments is wrong. Could you give me some advices to solve the problem? or which params should I tune to get a correct result?

Screenshot from 2021-03-16 11-11-23

ssheorey commented 3 years ago

Do you have Python OpenCV installed? If available, that is used for initialization. PS: Did you try the latest development wheel from here? http://www.open3d.org/docs/latest/getting_started.html#development-version-pip

Rogers34 commented 3 years ago

I am going to install Python Opencv. Do you have any tutorial that i can follow to initialize?

PS: I download from github release under v0.12.0 (open3d-0.12.0-cp36-cp36m-manylinux2014_x86_64.whl)

Rogers34 commented 3 years ago

I change the n_frames_per_fragment to 2000, and the i get a better result, but not very well. Screenshot from 2021-03-16 12-48-32

ssheorey commented 3 years ago

@theNded Can you take a look here?

theNded commented 3 years ago

If you are using colored icp, could you please try to use distance_threshold instead of voxel_size[scale] in https://github.com/intel-isl/Open3D/blob/master/examples/python/reconstruction_system/refine_registration.py#L80? You only have to rerun since the --refine step.

Rogers34 commented 3 years ago

I pip install the opencv-python And use distance_threshold instead of voxel_size[scale] Screenshot from 2021-03-19 12-44-07

$ python run_system.py --make --register --refine --integrate config/tutorial.json
Extracting frames from RGBD video file
../utility/file.py:124: UserWarning: Skipping frame extraction for /home/rogers/nowhere/data/realsense/20210316_100941.bag since files are present.
  warn(f"Skipping frame extraction for {rgbd_video_file} since files are"
====================================
Configuration
====================================
                                    name : Open3D reconstruction tutorial http://open3d.org/docs/release/tutorial/reconstruction_system/system_overview.html
                            path_dataset : /home/rogers/nowhere/data/realsense/20210316_100941
                               max_depth : 5.0
                              voxel_size : 0.1
                          max_depth_diff : 0.07
        preference_loop_closure_odometry : 0.1
    preference_loop_closure_registration : 5.0
                         tsdf_cubic_size : 5.0
                              icp_method : color
                     global_registration : ransac
                  python_multi_threading : True
                          depth_map_type : redwood
                   n_frames_per_fragment : 100
                 n_keyframes_per_n_frame : 5
                               min_depth : 0.3
                             depth_scale : 999.9999389648438
                         folder_fragment : fragments/
             template_fragment_posegraph : fragments/fragment_%03d.json
   template_fragment_posegraph_optimized : fragments/fragment_optimized_%03d.json
            template_fragment_pointcloud : fragments/fragment_%03d.ply
                            folder_scene : scene/
               template_global_posegraph : scene/global_registration.json
     template_global_posegraph_optimized : scene/global_registration_optimized.json
              template_refined_posegraph : scene/refined_registration.json
    template_refined_posegraph_optimized : scene/refined_registration_optimized.json
                    template_global_mesh : scene/integrated.ply
                    template_global_traj : scene/trajectory.log
                          path_intrinsic : /home/rogers/nowhere/data/realsense/20210316_100941/intrinsic.json
                              debug_mode : False
OpenCV is detected. Using ORB + 5pt algorithm
making fragments from RGBD sequence.
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
OpenCV is detected. Using ORB + 5pt algorithm
Fragment 001 / 013 :: RGBD matching between frame : 100 and 101
Fragment 002 / 013 :: RGBD matching between frame : 200 and 201
Fragment 000 / 013 :: RGBD matching between frame : 0 and 1
...

Screenshot from 2021-03-19 12-43-00

the result become better, but it seem still have some misalignment

theNded commented 3 years ago

Looks like the original data is pretty noisy.

  1. How is your scanning speed? If it is fast, you may end up with blurry fragments. One way is to visualize the fragments and see if there is any issue in the frontend reconstruction.
  2. How is the output of the pose graph optimization? How many edges can we observe after pruning? If there is a lack of loop closures, the backend optimization can be ill-posed and less optimal too.
ssheorey commented 3 years ago

Closing since original issue has been resolved and the issue author hasn't responded in some time. Please open a new issue or discussion.