This example creates a GUI application using Qt to visualize PolySync image data. It contains a threaded VideoProcessor (polysync::Node) that receives image data from the PolySync bus and packages it for rendering in a QWidget.
Sensors: Video Device
- Note: Sensor must be configured to publish MJPEG.
A Qt install and mesa-common-dev Debian package are required to run this example.
Navigate to Downloads directory
Make the installer executable NOTE: make sure the name of the *.run file matches
chmod +x qt-unified-online-installer.run
Run the installer, this can take up to 30 minutes NOTE: Only the desktop libraries are required, you can uncheck other elements (such as QtCreator) in the installer to speed up the process.
sudo apt install mesa-common-dev
Follow the build instructions.
Run the node.
Building and running the node
# Tell cmake where to find Qt, note that the path listed below may need to be modified if Qt is not in the default location or is a different version $ export CMAKE_PREFIX_PATH=~/Qt5.8.0/5.8/gcc_64 $ cd QtImageViewer $ mkdir build && cd build $ cmake .. $ make
# Note that the path listed below may need to be modified if Qt is not in the default location or is a different version $ export QT_QPA_PLATFORM_PLUGIN_PATH=~/Qt5.8.0/5.8/gcc_64/plugins/platforms $ ./polysync-qt-image-viewer-cpp
For more API examples, visit the "Tutorials" and "Development" sections in the PolySync Help Center here.