Results 1 to 4 of 4

Thread: Qt Gui with OpenCV video and buttons

  1. #1
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt Gui with OpenCV video and buttons

    Hi to all,

    I'd like to start learning Qt libraries, i've installed them on my Ubuntu 10.10 and I've read some code examples on this forum, in particular a topic about opencv included in a QT application.
    Before to start to code, i'd like to ask you if it is possible to realize a GUI which has a window divided in two parts: an upper part where i play a video or i display some images captured with OpenCV and a lower part (always in the same window) which has some buttons in order to control the application behavior.

    Do you think it's possible to do this?

    At the moment, i have an opencv application which display a video in a window and takes control in a console application and i'd like to have just a window with some buttons.

    If it is possible, is there any example which i can see?

    Thanks to all.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt Gui with OpenCV video and buttons

    Before to start to code, i'd like to ask you if it is possible to realize a GUI which has a window divided in two parts: an upper part where i play a video or i display some images captured with OpenCV and a lower part (always in the same window) which has some buttons in order to control the application behavior.

    Do you think it's possible to do this?
    Yes it is very much possible.

    If it is possible, is there any example which i can see?
    Example for what?
    For creating the GUI it self?
    This is what Qt is for - its a GUI tool kit.
    Just use the widgets you need.
    For displaying image data obtained by external sources such as opencv search the forum, or ask any specific question when you encounter problems.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt Gui with OpenCV video and buttons

    Thanks a lot for your answer.
    I'm pelased to know that what i want to do is possible with Qt.

    For my question about the example, i mean if it is possible to see an example with a widget which have an area where you can see the images and another area where there are buttons.

    I try to explain better what i'd like to do:

    I have two opencv applications:
    - application A: where i track an object and each time i save a frame in an image file and i control the application behavior with some commands which i write in the shell
    - application B: where i have a loop which reads every time the image file and display it

    I want to integrate application B in application A in order to show a window like the one which i've included in this post in order to have a loop which shows image in the first area and to use buttons in order to give commands which at the moment i write in the shell.

    Do you think it's possible to display the frames in an area with Qt?

    At the moment, my application B is very simple:
    Qt Code:
    1. while(1)
    2. {
    3. Mat img=imread("result.jpg",1);
    4. if(!img.empty())
    5. imshow("HOG",img);
    6. if(waitKey(200)==27) break;
    7. }
    To copy to clipboard, switch view to plain text mode 
    I like to show frames in a Qt window (I'm using Ubuntu).

    There is some example based on a template similar to what i'd like to do?
    (like the jpg image which i've included in this post)
    Attached Images Attached Images
    Last edited by marcusbarnet; 19th May 2011 at 22:40.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt Gui with OpenCV video and buttons

    For my question about the example, i mean if it is possible to see an example with a widget which have an area where you can see the images and another area where there are buttons.
    This is a trivial case of a GUI.
    Its where you have a bunch of widgets on a form.
    If these widgest are used for showing video or for something else is relevant for the example.
    Just open designer, drag and drop the widgets you need, and you have your form done in 5 minutes.
    You can use a QWidget or a QLabel as your video frame widget.
    Its too trivial to have an example for.
    Here you have an example how to make GUI using designer:
    http://doc.qt.nokia.com/latest/desig...ick-start.html
    I want to integrate application B in application A
    Build application B as a library, and link to it from application A.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. how to set duration of a video in a video player in qt
    By qt_user in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2010, 10:51
  2. Playing video using Phonon video widget
    By Leolander in forum Newbie
    Replies: 0
    Last Post: 26th February 2010, 06:15
  3. Replies: 3
    Last Post: 5th July 2009, 17:22
  4. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 08:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.