I want to create an application which basically captures a webcam feed and applies a custom shader effect on it, for Windows. I could use GLSL, HLSL, any shader language really.
I've tried to use Qt, which has some very nice examples with QML and Qt Mobility, but unfortunately, it doesn't capture my webcam at all! And I didn't really find any solution to my problem. I'm using Windows 7 64-bit.
So my question is: what tools should I use to build a simple app for this quickly? languages, APIs, any tip is kindly welcome!
I would use OpenCV to capture the image from the WebCam and D3D or OpenGL to create a texture form the captured image. Here is an example.
Afterwards, I would draw a full-screen quad with the texture where you can apply your shader effects.
OpenCV can be easily built with CMake or you can download a prebuild version.
Related
I am working on OpenGL to create a GUI .I want to create some tabs which will help me to display different things in different windows. How is this possible using OpenGL? I read in some articles that we can use QT for that. Since I have already developed some of the GUI part in OpenGL using GLUT library ,is it possible to use the same code in QT? If so brief me how to make settings for OpenGL libraries in QT creator.
In my GUI I am trying to create a Car which is following a track.
I think you might be mixing some things up: OpenGL is a API with which you can instruct drivers to draw visual primitives, like lines, boxes, 3D triangles, pictures from buffer onto a render plane.
GLUT is a library that gives you a minimal environment around that, ie. it handles creating a window etc.
Neither of them are high-level UI description tools. Qt is really most likely what you want, as it will not only give you things like tab widgets etc, but also a feature-rich framework to do things like defining what should happen when you click a button, close a window etc.
There's a lot of examples of OpenGL usage within Qt widgets. In fact, a lot of visualization frontends use Qt and OpenGL. Qt has extensive documentation on how to generate OpenGL contextes and draw inside Qt applications.
I am new to Qt and was curious if we can develop HMI for a Cluster(Instrument Cluster Panel) using Qt.
Can someone share a demo?
I might be in a wrong place to post this question, please don't flag.
I am looking for Examples/Demo in QT 5. (5.3.1)
Look at this widgets on Qt Apps website:
http://qt-apps.org/content/show.php/AnalogWidgets?content=87780
As you can see there are many beautiful widgets. For example:
There is also Qwt: well documented tool with a lot of different technical widgets.
http://qwt.sourceforge.net/index.html
From here
A good example is a dial-type control which combines Image elements with Rotation transforms and SpringAnimation behaviors to produce an interactive speedometer-type dial. You can find the example in the installed Qt directory in Examples/Qt-5.3/quick/customitems/dialcontrol.
I'm looking how to portably play video on Qt, but not Phonon.
Using ffmpeg seems to be a good idea (it should work the same way on all platforms).
Currently It uses QLabel for video output and does QPixmap::fromImage for each frame; frames which are decoded and buffered by QtFFmpegWrapper in a background thread. QTimer decides when to show the next frame.
The whole thing looks a bit hacky (Video? In a label?). Am I doing it right? Is there a better portable way of playing ffmpeg-decoded video in a Qt application?
You might want to have a look to Qt Multimedia module in Qt 5.0: http://doc-snapshot.qt-project.org/5.0/qtmultimedia/qtmultimedia-index.html. It should be more efficient than the process you described (it depends on the platform).
EDIT: For versions previous to Qt 5.0 you can still try the Qt Multimedia module using the Qt Multimedia Kit compiling Qt Mobility, but I never tried it myself.
I'm trying to render some simple qt application, that uses QGraphicsView with
QGLWidget as a viewport ( slightly modified collidingmice ) on armv7 embedded platform
( beagleboard ). Starting application like this:
collidingmice -platform eglfs
But screen is always remains dark. ( textures example is working fine ).
Is qt lighthouse able to render painting throught opengles with platform like elgfs?
I can't find any precise information about it.
Thanks in Advance.
I just had a look to the sources here. The driver is not making any assumptions on your windows system, so it is using 0 as the default native window handle, which is often correct. This may not be the case for your platform. You'll have to modify the sources so that the function eglCreateWindowSurface is passed a valid native window handle. I suspect that might be the reason of the black screen.
EDIT: I don't know what exactly that library libpvrPVR2D_FRONTWSEGL.so does, but according to the name that may be what will provide the native window on the framebuffer. Read the manual of that library.
EDIT2: That library provides in fact the Window System. Look here: http://processors.wiki.ti.com/index.php/SGXDbg. You could also use Qt Embedded instead of Qt QPA as there is a working driver for the PowerVR: http://qt.gitorious.org/qt/qt/trees/4.8/src/plugins/gfxdrivers/powervr.
I have enabled qt+OpenGl+SimpleGl on one of the ARM platform and was able to run opengl example programs.
I also has a qt+Webkit, which is working with a graphic plugin.
I wanted to use simpleGl context for every thing, instead of using the normal graphic screen. So, when I try to run Qt+Webkit with simpleGl, I just get a blank screen.
Does QT support this? If so how can we make it?
Yes, this is correct. OpenGL draws directly to the framebuffer. The simplegl driver doesn't handle what is drawn using the raster paint engine of the QWS, so you may see only black.
Using simplegl for "everything" means you want everything to be drawn using OpenGL in your EGL full-screen window? This is possible under some assumptions. You have to write all your applications to be rendered using the Qt OpenGL paint engine (using the opengl graphics system is not supported under Qt/E). This is possible also for QtWebKit, I'm doing it now. Note that this does not mean that everything is rendered using hardware acceleration. You'll have to write your applications "the right way" to get all actually hardware accelerated. Consider that you'll have to handle the mouse pointer some other way in this case.
The other way is to just modify the simplegl driver to allow for the use of Qt applications using the raster paint engine. This is possible as well with some limitations. Qt can use blit to place its own windows over OpenGL. Look for the framebuffer driver inside the Qt source tree to know how to do this. You can then have common Qt applications and OpenGL Qt applications some way. I'm doing this as well. Not everything can be done anyway.
EDIT: I'm sure you already did, but in case, give this http://doc.qt.io/qt-4.8/qt-embeddedlinux-opengl.html much attention.
Unfortunately I don't know anything about SimpleGL, but I do know that there is a way to render a standard Qt widget in a QGLWidget. Maybe have a look at this Qt Quarterly which I think is somewhat related to your question:
http://doc.qt.nokia.com/qq/qq26-openglcanvas.html