本文整理汇总了C++中vpImagePoint::set_j方法的典型用法代码示例。如果您正苦于以下问题:C++ vpImagePoint::set_j方法的具体用法?C++ vpImagePoint::set_j怎么用?C++ vpImagePoint::set_j使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vpImagePoint
的用法示例。
在下文中一共展示了vpImagePoint::set_j方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*!
Get the extremities of the line.
\param ip1 : Coordinates of the first extremity.
\param ip2 : Coordinates of the second extremity.
*/
void
vpMeLine::getExtremities(vpImagePoint &ip1, vpImagePoint &ip2)
{
/*Return the coordinates of the extremities of the line*/
ip1.set_i( PExt[0].ifloat );
ip1.set_j( PExt[0].jfloat );
ip2.set_i( PExt[1].ifloat );
ip2.set_j( PExt[1].jfloat );
}
示例2: the
/*!
Computes the intersection point of two lines. The result is given in
the (i,j) frame.
\param line1 : The first line.
\param line2 : The second line.
\param ip : The coordinates of the intersection point.
\return Returns a boolean value which depends on the computation
success. True means that the computation ends successfully.
*/
bool
vpMeLine::intersection(const vpMeLine &line1, const vpMeLine &line2,
vpImagePoint &ip)
{
double a1 = line1.a;
double b1 = line1.b;
double c1 = line1.c;
double a2 = line2.a;
double b2 = line2.b;
double c2 = line2.c;
try{
double i=0, j=0;
double denom = 0;
if (a1 > 0.1)
{
denom = (-(a2/a1) * b1 + b2);
//if (denom == 0)
if (std::fabs(denom) <= std::numeric_limits<double>::epsilon())
{
std::cout << "!!!!!!!!!!!!! Problem : Lines are parallel !!!!!!!!!!!!!" << std::endl;
return (false);
}
//if (denom != 0 )
if (std::fabs(denom) > std::numeric_limits<double>::epsilon())
{
j = ( (a2/a1)*c1 - c2 ) / denom;
i = (-b1*j - c1) / a1;
}
}
else
{
denom = (-(b2/b1) * a1 + a2);
//if (denom == 0)
if (std::fabs(denom) <= std::numeric_limits<double>::epsilon())
{
std::cout << "!!!!!!!!!!!!! Problem : Lines are parallel !!!!!!!!!!!!!" << std::endl;
return (false);
}
//if (denom != 0 )
if (std::fabs(denom) > std::numeric_limits<double>::epsilon())
{
i = ( (b2/b1)*c1 - c2 ) / denom;
j = (-a1*i - c1) / b1;
}
}
ip.set_i( i );
ip.set_j( j );
return (true);
}
catch(...)
{
return (false);
}
}