cvlab-epfl / segmentation-driven-pose

Segmentation-driven 6D Object Pose Estimation. CVPR 2019.
GNU General Public License v3.0
184 stars 37 forks source link

SolvePnPRansac - Assertion failed on matrix.cpp line 2355 #10

Closed gjcamacho closed 5 years ago

gjcamacho commented 5 years ago

Hello,

Would you kindly share the versions of OpenCV and Pytorch used to run 'python test.py'? I am getting Assertion failure on matrix.cpp@2355 line after the method solvePnPRansac call at utils.py:204.

Thank you very much for your attention

gjcamacho commented 5 years ago

Fortunately, I found how to solve the issues:

For Python 3.6.9, OpenCV 3.1.0 and Pytorch 1.1.0: utils.py, line 204: add 1 dimension to variables p3d and p2d so that their shape becomes: Nx1x3 and Nx1x2 utils.py, line 271: change line beginning from 'contours, _ = [...]' to 'img, countours, hierarchy = [...]'

Hope it helps.

YinlinHu commented 5 years ago

That is it. different OpenCV versions on python binding have slightly different parameters.