raphaelschwinger / cone_reconstruction

0 stars 1 forks source link

Fix run reconstruction for new blender file #29

Closed raphaelschwinger closed 3 years ago

raphaelschwinger commented 3 years ago

We need to adapt our scripts to the new blender file, so that we are again able to reconstruct the scene and transform the reconstructed points into the coordinate system of the blender file.

raphaelschwinger commented 3 years ago

For the first 2 frames it works again :tada:

The following error gets thrown for frame 77:

added 3Dpoint to map at [0.04297714 0.28263018 1.63861389]
not in front 15 [-2.27777302 -0.70361185 -2.99604913  1.        ] [3345.76196289 1480.88302374]

which results in:

Traceback (most recent call last):
  File "run_reconstruction.py", line 78, in <module>
    positions = track.processFrame(img, points_2D, K)
  File "/workspace/track_reconstruction/track.py", line 174, in processFrame
    _, rvecs, tvecs, _ = cv2.solvePnPRansac(self.map.getPointsAs3DArray(), self.cameras[cam_id].points_2D, cameraMatrix=K, distCoeffs=None)
cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-rcdoave0/opencv/modules/calib3d/src/solvepnp.cpp:241: error: (-215:Assertion failed) npoints >= 4 && npoints == std::max(ipoints.checkVector(2, CV_32F), ipoints.checkVector(2, CV_64F)) in function 'solvePnPRansac'

I dont know what is happening here, I will try to find the reason.

raphaelschwinger commented 3 years ago

I think that the reconstruction error occurs when the tracking results of the 3 cameras differs so much, that the reconstruction results in a recovered pose that does not match the ones from the other cameras. So we need to improve tracking for that. And this PR can be merged into #23