[ros-users] opencv assertion failure with PinholeCameraModel::rectifyPoint

Patrick Mihelich mihelich at willowgarage.com
Wed May 5 20:49:31 UTC 2010


Thanks David, this was a bug in image_geometry. It's now fixed on trunk,
issue #4053 <https://code.ros.org/trac/ros-pkg/ticket/4053>.

Patrick

On Sun, May 2, 2010 at 3:16 AM, David Feil-Seifer <
david.feilseifer at gmail.com> wrote:

> When using the PinholeCameraModel class, I'm getting the following
> runtime error:
>
> OpenCV Error: Assertion failed (src.isContinuous() && src.depth() ==
> CV_32F && ((src.rows == 1 && src.channels() == 2) ||
> src.cols*src.channels() == 2)) in undistortPoints, file
>
> /home/dfseifer/ros/stacks/vision_opencv/opencv2/build/opencv-svn/src/cv/cvundistort.cpp,
> line 383
>
> with the following code:
>
>          cv::Point2d uv;
>          uv.x = b.x; uv.y = b.y; //valid image coords
>          cv::Point2d uvrect;
>          pcam_.rectifyPoint( uv, uvrect );
>
> I made this error go away when I changed the rectifyPoint section to
> the following:
>
>
>  const cv::Mat src_pt(1, 1, CV_32FC2, const_cast<double*>(&uv_raw.x));
>  cv::Mat dst_pt(1, 1, CV_32FC2, &uv_rect.x);
>  cv::undistortPoints(src_pt, dst_pt, K_, D_, R_, P_);
>
> where CV_32FC2 used to be CV_64FC2
>
> I am using box_turtle release (updated today) with Ubuntu 10.04.
>
> My question is, was this a bug in the image_geometry package, or was
> my code wrong?
>
> Thanks as always,
> -Dave
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100505/2388a701/attachment-0003.html>


More information about the ros-users mailing list