本文整理汇总了C++中BoardDetector::isYPerpendicular方法的典型用法代码示例。如果您正苦于以下问题:C++ BoardDetector::isYPerpendicular方法的具体用法?C++ BoardDetector::isYPerpendicular怎么用?C++ BoardDetector::isYPerpendicular使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoardDetector
的用法示例。
在下文中一共展示了BoardDetector::isYPerpendicular方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vDrawScene
void vDrawScene() {
if (TheResizedImage.rows == 0) // prevent from going on until the image is initialized
return;
/// clear
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/// draw image in the buffer
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, TheGlWindowSize.width, 0, TheGlWindowSize.height, -1.0, 1.0);
glViewport(0, 0, TheGlWindowSize.width, TheGlWindowSize.height);
glDisable(GL_TEXTURE_2D);
glPixelZoom(1, -1);
glRasterPos3f(0, TheGlWindowSize.height - 0.5, -1.0);
glDrawPixels(TheGlWindowSize.width, TheGlWindowSize.height, GL_RGB, GL_UNSIGNED_BYTE,
TheResizedImage.ptr(0));
/// Set the appropriate projection matrix so that rendering is done in a enrvironment
// like the real camera (without distorsion)
glMatrixMode(GL_PROJECTION);
double proj_matrix[16];
TheCameraParams.glGetProjectionMatrix(TheInputImage.size(), TheGlWindowSize, proj_matrix, 0.05, 10);
glLoadIdentity();
glLoadMatrixd(proj_matrix);
glLineWidth(2);
// now, for each marker,
double modelview_matrix[16];
/* for (unsigned int m=0;m<TheMarkers.size();m++)
{
TheMarkers[m].glGetModelViewMatrix(modelview_matrix);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glLoadMatrixd(modelview_matrix);
// axis(TheMarkerSize);
glColor3f(1,0.4,0.4);
glTranslatef(0, TheMarkerSize/2,0);
glPushMatrix();
glutWireCube( TheMarkerSize );
glPopMatrix();
}*/
// If the board is detected with enough probability
if (TheBoardDetected.second > 0.3) {
TheBoardDetected.first.glGetModelViewMatrix(modelview_matrix);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glLoadMatrixd(modelview_matrix);
glColor3f(0, 1, 0);
axis(TheMarkerSize);
if (TheBoardDetector.isYPerpendicular())
glTranslatef(0, TheMarkerSize / 2, 0);
else
glTranslatef(0, 0, TheMarkerSize / 2);
glPushMatrix();
glutWireCube(TheMarkerSize);
glPopMatrix();
}
glutSwapBuffers();
}