Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:26:59+00:00 2026-05-29T05:26:59+00:00

Does anybody know a good tutorial or documentation that deals with mixing OpenCV and

  • 0

Does anybody know a good tutorial or documentation that deals with mixing OpenCV and OpenGL in C++, related with Computer Vision and 3D rendering?

I want to create virtual scenarios with objects and then find object's 3D poses using OpenCV, so I can compare with the known OpenGL position but I didn’t find much “quality” information so far. For example, I would need the intrinsic parameters of the opengl camera in order to use OpenCV for detecting objects in 3D world, etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:27:00+00:00Added an answer on May 29, 2026 at 5:27 am

    There is nothing difficult in mixing OpenGL and OpenCV. These are just two libraries, one for graphics and the other for computer vision. There is no overlap so you can just include both in your project.

    Then it should be a matter of rendering some rectangle or a box (or whatever you wish to locate using OpenCV) – there are plenty of tutorials for that, and then copying the rendered data using the glReadPixels() function to client memory and passing that to OpenCV.

    There is no tutorial most likely because it is so simple …

    You can just:

    void onDisplay(void* param)
    {
        glClearColor(0, 1, 0, 1);
        glClear(GL_COLOR_BUFFER_BIT); // Make a green window.
    }
    
    ...
    
    void MyClass::MyInit(bool useCustomInit)
    {
        std::string winname = "MyWnd";
        if (useCustomInit) {
            namedWindow(winname, CV_WINDOW_NORMAL);
            resizeWindow(winname, 640, 480);
            auto handle = cvGetWindowHandle(winname.c_str());
            InitializeOpenGL(handle); // your custom OpenGL initialization.
        } else {
            namedWindow(winname, CV_WINDOW_NORMAL | CV_WINDOW_OPENGL);
            resizeWindow(winname, 640, 480);
        }
        void *param_value = reinterpret_cast<void*>(this); // Can e.g. do this or just use nullptr.
        setOpenGlDrawCallback(winname, onDisplay, param_value);
    
        // ...
    }
    

    If you’re happy with default OpenGL window, you can use the Init(false). If you want fancy bit depths and stencil buffers and whatnot, initialize OpenGL yourself using the OS’ window handle. There are really really many tutorials for doing that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know a good tutorial about Squid plug-in development?
Does anybody know a good C sample that loads bitmaps and handles all the
Does anybody know a good web framework that includes an ORM mapper and allows
Does anybody know of a good solid plugin that allows a user to have
I've hit a wall. Does anybody know a good text editor that has search
Does anybody know of any good tutorials that show how to configure FluentNhibernate for
Does anybody know any good 2D game engines for Java? I'd like one that
Does anybody know a good program that makes translation of Localizable.strings file not such
Does anybody know any good video tutorial for Emacs (basics)? I found very good
Does anybody know any good simple youtube search scripts in php that I could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.