extended cv::convertPointsHomogeneous to handle 4D input. corrected documentation

This commit is contained in:
Vadim Pisarevsky
2010-11-18 22:03:20 +00:00
parent fd7b058b8b
commit ea6b441052
2 changed files with 7 additions and 8 deletions

View File

@@ -1134,10 +1134,10 @@ void cv::computeCorrespondEpilines( const Mat& points, int whichImage,
void cv::convertPointsHomogeneous( const Mat& src, vector<Point3f>& dst )
{
CV_Assert(src.checkVector(2) >= 0 &&
(src.depth() == CV_32F || src.depth() == CV_32S));
int srccn = src.checkVector(2) >= 0 ? 2 : src.checkVector(4) >= 0 ? 4 : -1;
CV_Assert( srccn > 0 && (src.depth() == CV_32F || src.depth() == CV_32S));
dst.resize(src.cols*src.rows*src.channels()/2);
dst.resize(src.cols*src.rows*src.channels()/srccn);
CvMat _src = src, _dst = Mat(dst);
cvConvertPointsHomogeneous(&_src, &_dst);
}