当前位置: 首页>>代码示例>>C++>>正文


C++ OutputArray::size方法代码示例

本文整理汇总了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());
		}
	}
开发者ID:norishigefukushima,项目名称:OpenCP,代码行数:67,代码来源:disparityFitPlane.cpp


注:本文中的cv::OutputArray::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。