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


C++ BoardDetector::isYPerpendicular方法代码示例

本文整理汇总了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();
}
开发者ID:paroj,项目名称:aruco,代码行数:61,代码来源:aruco_test_board_gl.cpp


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