Hi Phil,<br><br>You're looking for <a href="http://opencv.willowgarage.com/documentation/cpp/camera_calibration_and_3d_reconstruction.html#cv-solvepnp">cv::solvePnP</a>. The error probably means you haven't shaped either your objectPoints or imagePoints correctly; check the documentation and make sure the dimensions and channel type are what OpenCV expects.<br>
<br>Cheers,<br>Patrick<br><br><div class="gmail_quote">On Wed, Jul 21, 2010 at 3:22 PM, Phil Osteen <span dir="ltr"><<a href="mailto:prosteen@ufl.edu">prosteen@ufl.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi I have written a ROS node that implements a camera calibration<br>
given intrinsic parameters and a chessboard pattern.<br>
<br>
I want to use FindExtrinsicCameraParams2, and it would be nice to<br>
have a templated cv:: function for it, but I cannot find one<br>
anywhere in my environment. Is the ROS version of OpenCV missing<br>
any C++ functionality versus OpenCV2.1?<br>
<br>
So, I resorted to trying to convert the cv::Mat objects I have to<br>
CvMat objects using the simple operator. I assume, since there is<br>
no data copying, that the matrix header is the only change made. I<br>
also assume that I can use the cvFindExtrinsicCameraParams2<br>
function with my newly-created CvMat objects.<br>
<br>
I run into an error, however, since I cannot directly copy-paste<br>
my code so here's a quick rundown.<br>
<br>
// I have a populated STL vector of Mats<br>
vector<Mat> distortion_coeffs;<br>
//I create cv::Mats<br>
Mat distortion(rows,cols,CV_64FC3);<br>
//Then, populate all of them except tvec,rvec<br>
distortion_coeffs[0].copyTo(distortion);<br>
//Then copy to the old CvMat struct<br>
CvMat distortion_old = distortion;<br>
<br>
// Then call cvFindExtrinsicCameraParams2<br>
<br>
OpenCV Error: Incorrect size of input array (Either the number of<br>
channels or columns or rows must be =1) in<br>
cvConvertPointsHomogeneous, file<br>
/opt/ros/boxturtle/stacks/vision_opencv/opencv2/build/opencv-svn/src/cv/cvfundam.cpp<br>
<br>
<br>
I am running boxturtle on Ubuntu Karmic 2.6.31-14. Thanks for any<br>
help.<br>
<br>
--<br>
Phil Osteen<br>
BS Aerospace Engineering, University of Florida<br>
MS Mechanical Engineering, University of Florida<br>
Research Assistant, Center for Intelligent Machines and Robotics<br>
(UF)<br>
Researcher, Grupo de Sistemas y Automatica, Universidad de<br>
Sevilla<br>
Robotics Research Engineer, Motile Robotics Inc<br>
<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br>