How to execute OpenGL pixel shaders on top of openCV images structures? is there any library or plugin for OpenCV for that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I won’t include setting up a OpenGL context, performing actual render operations etc. Consider this as an outline in pseudo code just trying to give you an idea on how you could do it (assuming you’d like to reuse the ouput in OpenCV:
At first you create a texture (has to be done once only, of coirse), then you upload the image data from OpenCV to the created texture (or update it).
Now your OpenCV image is in an OpenGL texture. Later on you just have to render your image and retrieve the pixel data.
This should work, however don’t forget that you’ll have to use the correct texture formats to not screw up your image data and you might have to use another buffer (right now I’m not 100% sure if you could write the image data right into your OpenCV image).
Edit: You can render to screen or a framebuffer object, the basic concept stays the same. Just ensure you render to the correct target.