Re: [ros-users] opencv assertion failure with PinholeCameraM…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Patrick Mihelich
Date:  
To: ros-users
Subject: Re: [ros-users] opencv assertion failure with PinholeCameraModel::rectifyPoint
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 <
> 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
>
> https://code.ros.org/mailman/listinfo/ros-users
>