1 | initial version |
The answer above doesn't solve the problem. The problem is, the wrong functions is called. It should be cv::projectPoints, but it is cv::fisheye::projectPoints instead (they have the same name but different interfaces). The error occurs in the first place, because arguments pass the interface, but fail checking their size inside the function. If you change their positions according to the answer above, you'll just make it correct for the wrong function. And there still will be an error, this time because fisheye projectPoints require four distortion coefficients and from the standard camera calibration you got five.
The solution that works for me is, because projectPoints_1 should call cv::projectPoints, but calls cv::fisheye::projectPoints instead, what about projectPoints_3, which should call the latter? And indeed, they seem to be switched, and projectPoints_3 calls cv::projectPoints. If you change projectPoints_1 in your code to projectPoints_3 it works as it should.