solvePnpRansac GPU assertion failed
<p>I'm trying to use the gpu version of solvePnPRansac to estimate the pose of the camera, but I get the following error:</p>

<p><strong>OpenCV Error: Assertion failed (object.rows == 1 &amp;&amp; object.cols > 0 &amp;&amp; object.type() == CV_32FC3) in cv::gpu::solvePnPRansac, file C:\opencv\sources\modules\gpu\src\calib3d.cpp, line 218</strong></p>

<p>If I run my code using the solvePnP or cpu-based solvePnPRansac, everything works fine.</p>

<p>I took a look into the code of calib3d.cpp at line 218 and the problem seems to be related to the first parameter of the function (that should be the list of the reference points).</p>

<p>It seems that the format that I use to send the reference point to the function is wrong, but I didn't figure out which one is correct.</p>

<p>Here is my code:</p>

<pre><code>// Reference Points and Detected Points for Pose Estimation
std::vector&lt;cv::Point3f&gt; refMarkerPoint;
std::vector&lt;cv::Point2f&gt; markerPoints;

...

cv::Mat rvec = cv::Mat::zeros(1, 3, CV_32F);
cv::Mat tvec = cv::Mat::zeros(1, 3, CV_32F);
cv::Mat rotation = cv::Mat::zeros(1, 3, CV_32F);
cv::Mat tvec2 = cv::Mat::zeros(1, 3, CV_32F);
Vec3d eulerAngles;

...

if (cx_right != 0 &amp;&amp; cx_left != 0 &amp;&amp; markerPoints.size() &gt; 0)
{
    marker_detected = 1;
    //solvePnPRansac(refMarkerPoint, markerPoints, cameraMatrix, distCoeffs, rvec, tvec, false, 20, 4, 20, noArray(), CV_ITERATIVE); // CV_EPNP, CV_P3P
    //solvePnP(Mat(refMarkerPoint), Mat(markerPoints), cameraMatrix, distCoeffs, rvec, tvec);
    gpu::solvePnPRansac(Mat(refMarkerPoint), Mat(markerPoints), cameraMatrix, distCoeffs, rvec, tvec);

    cv::Rodrigues(rvec, rotation);


    ...
}
</code></pre>

<p>Do you have any suggestions?</p>