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


C++ Shot::Project方法代码示例

本文整理汇总了C++中Shot::Project方法的典型用法代码示例。如果您正苦于以下问题:C++ Shot::Project方法的具体用法?C++ Shot::Project怎么用?C++ Shot::Project使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shot的用法示例。


在下文中一共展示了Shot::Project方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: return

vcg::Point2f Parameters::pixelDiff(Shot &test, vcg::Point3f p)
{
  vcg::Point2f before = reference.Project(p)*rx;
  if(before[0] < 0 || before[0] > reference.Intrinsics.ViewportPx[0] || before[1] < 0 || before[1] > reference.Intrinsics.ViewportPx[1])
	  return vcg::Point2f(0, 0);
  vcg::Point2f after = test.Project(p)*rx;
  return (after - before);
}
开发者ID:GuoXinxiao,项目名称:meshlab,代码行数:8,代码来源:parameters.cpp

示例2:

double Solver::calculateError2( Shot &shot){
	//E' una pezza, andrebbe meglio pensato. Va a beccare direttamente le strutture dati PointCorrespondence di base.
	//align già è sicuramente settato perchè lo chiami da optimize (poi dovrai distinguere le due cose, p.e. fare un optimize2)
	QList<PointCorrespondence*> *correspList = align->correspList;
	double error = 0;
	int count=0;

    for( int i=0; i<correspList->count(); i++){
        PointCorrespondence *corr = correspList->at(i);
        PointOnLayer currentPointOnLayer1= corr->getPointAt(0);
        PointOnLayer currentPointOnLayer2= corr->getPointAt(1);
        PointType type1 = currentPointOnLayer1.getType();
        vcg::Point3f currentPoint1(currentPointOnLayer1.pX, currentPointOnLayer1.pY,currentPointOnLayer1.pZ );
        vcg::Point3f currentPoint2(currentPointOnLayer2.pX, currentPointOnLayer2.pY,currentPointOnLayer2.pZ );
        vcg::Point2f p2adj;
		vcg::Point2f p1proj;
        if(type1==_3D_POINT){
            //Adjust 2D point
			p2adj = vcg::Point2f(((currentPoint2.X()/align->imageRatio) +1)/2.0 * shot.Intrinsics.CenterPx.X()*2.0,((currentPoint2.Y())+1)/2.0 * shot.Intrinsics.CenterPx.Y()*2.0);
			//Project 3D point
			p1proj = shot.Project(currentPoint1);
        }
        else{
           //Adjust 2D point
			p2adj = vcg::Point2f(((currentPoint1.X()/align->imageRatio) +1)/2.0 * shot.Intrinsics.CenterPx.X()*2.0,((currentPoint1.Y())+1)/2.0 * shot.Intrinsics.CenterPx.Y()*2.0);
			//Project 3D point
			p1proj = shot.Project(currentPoint2);
        }

		float dist = vcg::Distance<float>(p1proj,p2adj);
		error += dist;
		count++;
	}

	//Normalize error
	return error /= count;

}
开发者ID:GuoXinxiao,项目名称:meshlab,代码行数:38,代码来源:solver.cpp


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