Ask Your Question
1

Advice to create GUI for OpenCV app

asked 2013-10-26 07:51:04 -0600

Deaddn gravatar image

updated 2013-10-26 08:03:08 -0600

berak gravatar image

Hi. I'm pretty new to OpenCV, but i would like, as I learn, to create GUI for algorithms I create. I know pretty well C#, but I don't want to use EmguCV or other wrappers (because or performance). What I want to do is to have a windows forms application for GUI and use c++ OpenCV code for image processing. For example: I browse for an image, press a button to send it to opencv function, I process it there and finally i send it back to c# for display. I tried to create some dlls but I failed to make them work. Do you know some tutorials or do you recommend other ways to create a GUI? (not c# win forms)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-10-27 19:49:04 -0600

stereomatching gravatar image

updated 2013-10-27 19:50:04 -0600

Qt is a good choice if you don't want to use c#.It is an open source project, support multiple major platforms--windows, mac, linux, ios, android, blackberry and so on.

There are many versions of Qt on the download page, I would explain the windows versions at here.

There are three compilers prebuild binaries of Qt

  • mingw
  • vc2010
  • vc2012

vc2012 and vc2010 support openGL and angle, angle is an open source project to map OpenGL ES 2.0 API calls to DirectX 9 API.openGL is needed by QtQuick2(another way to describe gui);If you prefer the openGL version, you may need to upgrade your graphic cards driver for better openGL support, else the gui describe by QtQuick2 may not function properly, besides, some graphics cards do not have decent openGL support, if you want to make sure your gui could port to most of the desktops, don't use QtQuick2.

The other point you need to know is how to convert the QImage(one of the image container provided by Qt) and cv::Mat properly.

conversion between QImage and cv::Mat

angle or opengl

QtQuick

edit flag offensive delete link more
0

answered 2013-10-26 10:41:53 -0600

antonio gravatar image

updated 2013-10-26 10:45:23 -0600

Look at the answer posted here: "http://answers.opencv.org/question/22564/how-to-do-opencv-in-windows-application/#22579" it gives an example for combining winforms and OpenCV.

Another option is to use Qt. However, you first need to build OpenCV with Qt support. This requires 3 steps: 1. build Qt from source. 2. configure OpenCV with QT support (see the answer given here for these 2 steps: http://answers.opencv.org/question/22816/how-to-set-the-path-to-qt5-in-cmake/#22817), and 3. build OpenCV (this is pretty standard, just build the solution generated with Cmake (see step 2)).

A nice step-by-step tutorial for creating a GUI application using OpenCV with Qt support is given here: http://www.youtube.com/watch?v=0ONxIy8itRA

edit flag offensive delete link more

Comments

Hi, you don't need to build Qt from source, you could download the binary from here--http://qt-project.org/downloads.

stereomatching gravatar imagestereomatching ( 2013-10-27 19:30:29 -0600 )edit

I know you can, but to make it work with OpenCV you must build it using the Visual Studio command prompt. Otherwise it won't work. This is also recommended in OpenCV documentation

antonio gravatar imageantonio ( 2013-10-28 03:56:10 -0600 )edit

Question Tools

Stats

Asked: 2013-10-26 07:51:04 -0600

Seen: 5,840 times

Last updated: Oct 27 '13