本文整理汇总了C++中cv::OutputArray::size方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputArray::size方法的具体用法?C++ OutputArray::size怎么用?C++ OutputArray::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cv::OutputArray
的用法示例。
在下文中一共展示了OutputArray::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disparityFitPlane
void disparityFitPlane(cv::InputArray disparity, cv::InputArray image, cv::OutputArray dest, int slicRegionSize, float slicRegularization, float slicMinRegionRatio, int slicMaxIteration, int ransacNumofSample, float ransacThreshold)
{
//disparityFitTest(ransacNumofSample, ransacThreshold);
//cv::FileStorage pointxml("planePoint.xml", cv::FileStorage::WRITE); int err = 0;
Mat segment;
SLIC(image, segment, slicRegionSize, slicRegularization, slicMinRegionRatio, slicMaxIteration);
vector<vector<Point3f>> points;
SLICSegment2Vector3D_<float>(segment, disparity, 0, points);
Mat disp32f = Mat::zeros(dest.size(), CV_32F);
for (int i = 0; i < points.size(); ++i)
{
if (points[i].size() < 3)
{
if (!points[i].empty())
{
for (int j = 0; j < points[i].size(); ++j)
{
points[i][j].z = 0.f;
}
}
}
else
{
Point3f abc;
fitPlaneRANSAC(points[i], abc, ransacNumofSample, ransacThreshold, 1);
//for refinement(if nessesary)
int v = countArrowablePointDistanceZ(points[i], abc, ransacThreshold);
/*double rate = (double)v / points[i].size() * 100;
int itermax = 1;
for (int n = 0; n < itermax;n++)
{
if (rate < 30)
{
//pointxml <<format("point%03d",err++)<< points[i];
fitPlaneRANSAC(points[i], abc, ransacNumofSample, ransacThreshold, 1);
v = countArrowablePointDistanceZ(points[i], abc, ransacThreshold);
rate = (double)v / points[i].size() * 100;
}
}*/
for (int j = 0; j < points[i].size(); ++j)
{
points[i][j].z = points[i][j].x*abc.x + points[i][j].y*abc.y + abc.z;
}
}
}
SLICVector3D2Signal(points, image.size(), disp32f);
if (disparity.depth() == CV_32F)
{
disp32f.copyTo(dest);
}
else if (disparity.depth() == CV_8U || disparity.depth() == CV_16U || disparity.depth() == CV_16S || disparity.depth() == CV_32S)
{
disp32f.convertTo(dest, disparity.type(), 1.0, 0.5);
}
else
{
disp32f.convertTo(dest, disparity.type());
}
}