本文整理汇总了C++中Blob::getRightBottomX方法的典型用法代码示例。如果您正苦于以下问题:C++ Blob::getRightBottomX方法的具体用法?C++ Blob::getRightBottomX怎么用?C++ Blob::getRightBottomX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blob
的用法示例。
在下文中一共展示了Blob::getRightBottomX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawBlob
/* Draws the outline of a blob in the specified color.
* @param b the blob
* @param c the color to paint
*/
void Ball::drawBlob(Blob b, int c) {
#ifdef OFFLINE
thresh->drawLine(b.getLeftTopX(), b.getLeftTopY(),
b.getRightTopX(), b.getRightTopY(),
c);
thresh->drawLine(b.getLeftTopX(), b.getLeftTopY(),
b.getLeftBottomX(), b.getLeftBottomY(),
c);
thresh->drawLine(b.getLeftBottomX(), b.getLeftBottomY(),
b.getRightBottomX(), b.getRightBottomY(),
c);
thresh->drawLine(b.getRightTopX(), b.getRightTopY(),
b.getRightBottomX(), b.getRightBottomY(),
c);
#endif
}
示例2: printBlob
/* Print debugging information for a blob.
* @param b the blob
*/
void Robots::printBlob(Blob b) {
#if defined OFFLINE
cout << "Outputting blob" << endl;
cout << b.getLeftTopX() << " " << b.getLeftTopY() << " " << b.getRightTopX() << " "
<< b.getRightTopY() << endl;
cout << b.getLeftBottomX() << " " << b.getLeftBottomY() << " " << b.getRightBottomX()
<< " " << b.getRightBottomY() << endl;
#endif
}
示例3: updateRobot
/**
* Update the robot values from the blob
*
* @param b The blob to update our object from.
*/
void VisualRobot::updateRobot(Blob b)
{
setLeftTopX(b.getLeftTopX());
setLeftTopY(b.getLeftTopY());
setLeftBottomX(b.getLeftBottomX());
setLeftBottomY(b.getLeftBottomY());
setRightTopX(b.getRightTopX());
setRightTopY(b.getRightTopY());
setRightBottomX(b.getRightBottomX());
setRightBottomY(b.getRightBottomY());
setX(b.getLeftTopX());
setY(b.getLeftTopY());
setWidth(dist(b.getRightTopX(), b.getRightTopY(), b.getLeftTopX(),
b.getLeftTopY()));
setHeight(dist(b.getLeftTopX(), b.getLeftTopY(), b.getLeftBottomX(),
b.getLeftBottomY()));
setCenterX(getLeftTopX() + ROUND2(getWidth() / 2));
setCenterY(getRightTopY() + ROUND2(getHeight() / 2));
setDistance(1);
}
示例4: greenSide
/* When we're looking for balls it is helpful if they are surrounded by green.
* The best place to look is underneath, but that doesn't always work. So let's
* try the other sides.
* @param b the potential ball
* @return did we find some green?
*/
bool Ball::greenSide(Blob b)
{
const int ERROR_TOLERANCE = 5;
const int X_EXTRA = 8;
int x = b.getRightBottomX();
int y = b.getRightBottomY();
stop scan;
for (int i = y; i > (b.height()) / 2; i = i - 2) {
horizontalScan(x, i, 1, ERROR_TOLERANCE, GREEN, GREEN, x - 1,
x + X_EXTRA, scan);
if (scan.good > 0)
return true;
}
x = b.getLeftBottomX();
y = b.getLeftBottomY();
for (int i = y; i > (b.height()) / 2; i = i - 2) {
horizontalScan(x, i, -1, ERROR_TOLERANCE, GREEN, GREEN,
x - X_EXTRA, x + 1, scan);
if (scan.good == 0)
return true;
}
return false;
}