Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use c++ interface to show the image in the monitor? #20

Closed
dinghuawen opened this issue Nov 6, 2019 · 3 comments
Closed

how to use c++ interface to show the image in the monitor? #20

dinghuawen opened this issue Nov 6, 2019 · 3 comments

Comments

@dinghuawen
Copy link

i have a coral dev board. i want to show the detected result in my monitor. How can i use c++ interface to show the image in the monitor?

@Namburger
Copy link

Namburger commented Nov 6, 2019

@dinghuawen Since this query is beyond edgetpu library, I recommend you look into external cpp libraries for showing images like gstreamer c++ with autovideo sink or xvimagesink or ximagesink. Otherwise, you should looks into general linux tools for displaying images on linux systems.

@mtyka
Copy link

mtyka commented Nov 6, 2019

@dinghuawen , the answer strongly depends on what the rest of your app wants to do. Are you showing single images ? Are you streaming video with overlays ?
For video consider gstreamer with video/image sinks as Namburger suggested.
If you want to just have a graphical application, the devboard comes with Wayland (an X clone) which can support simple X windows or more sophisticated frameworks like Qt. Here's a minimal Qt app:

Simple hello world app:

#include <QApplication>
#include <QPushButton>
int main(int argc, char **argv) {
 QApplication app (argc, argv);
 QPushButton button ("Hello world !");
 button.show();
 return app.exec();
}

CMakeLists.txt for building:

cmake_minimum_required(VERSION 3.1.0)
project(helloworld)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
find_package(Qt5 COMPONENTS Widgets REQUIRED)
add_executable(helloworld main.cc )
target_link_libraries(helloworld Qt5::Widgets)

To run do:

sudo apt install qtbase5-dev qtwayland5 
cmake ./
make
./hello_world -platform wayland

@dinghuawen
Copy link
Author

Hi @mtyka, @Namburger
Thank you for the responses. I solved the problem according to your suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants