berak / opencv_smallfry

it did not fit anywhere else ..
Other
57 stars 25 forks source link

solvePNP assertion in pose2.cpp #4

Closed pkeir closed 3 years ago

pkeir commented 3 years ago

When I run pose2.cpp on with OpenCV 4.2.0 on Ubuntu 20.10 the program terminates after an assertion fires from within solvePnPGeneric (shown below). This happens either instantly; or after first showing my camera feed (without axis annotation) for a few seconds. The assert message is shown below. Do you have any idea what the cause is?

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.2.0) ../modules/calib3d/src/solvepnp.cpp:753: error: (-215:Assertion failed) ( (npoints >= 4) || (npoints == 3 && flags == SOLVEPNP_ITERATIVE && useExtrinsicGuess) ) && npoints == std::max(ipoints.checkVector(2, CV_32F), ipoints.checkVector(2, CV_64F)) in function 'solvePnPGeneric'

Aborted (core dumped)
berak commented 3 years ago

did you check the pts2d here:

https://github.com/berak/opencv_smallfry/blob/4fdcfb7ec0712d617b37d42a16af52ed848a25e1/headpose/pose2.cpp#L102

?

pkeir commented 3 years ago

Apologies: I was missing the points3d.yml file.