本文整理汇总了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);
}
示例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;
}