Results 1 to 8 of 8

Thread: Grab a frame from video when a push button is pressed!!!

  1. #1
    Join Date
    Aug 2014
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Grab a frame from video when a push button is pressed!!!

    Hi Everyone,

    I am creating a gui in Qt with openCV library. The thing is I can able to display a video in QLabel when a push button is pressed, but now I have to grab a frame from it when another pushButton is pressed and need to display it in another QLabel. How can I do It? Can someone help me out?

    Thanks in Advance!!!

    jakr1387
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Grab a frame from video when a push button is pressed!!!

    Just take the pixmap from the first label and also set it on the second.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Jakr1387 (28th August 2014)

  4. #3
    Join Date
    Aug 2014
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Grab a frame from video when a push button is pressed!!!

    Thanks anda_skoa!!!

    Just now saw your post and I did exactly what you said and made it working. I have another question if you dont mind. I have a video running in my first QLabel, I need to freeze it when i push some other button.

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Grab a frame from video when a push button is pressed!!!

    Depending on what kind of UI you want, you could use a QPushButton with setCheckable(true) and then check its "checked" state in the function that gets frames.
    Or use a normal push button and set a flag variable and check against that.

    Cheers,
    _

  6. #5
    Join Date
    Aug 2014
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question How to update Qlabel with new Image!!!

    Hi everyone!!!

    I have a small issue in displaying a new image in Qlabel. I have a video running in Qlabel when a pushbutton is pressed, and I am grabing a frame from the video and updating the same Qlabel when another pushbutton is pressed. My problem here is when I push the second pushbutton, Qlabel is loaded with old frame, but when I push the second push button again, I am getting my frame in Qlabel.


    Can someone suggest me what is an issue?


    Thanks in advance!!!

    jakr1387

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to update Qlabel with new Image!!!

    The issue is you are setting an incorrect pixmap on the label.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #7
    Join Date
    Aug 2014
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Re: How to update Qlabel with new Image!!!

    Hi wysota,

    I could not find anything. I am pointing to the correct label, maybe I have something missing. Plz find the attached code


    thanks in advance!!
    jakr1387
    Attached Files Attached Files

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to update Qlabel with new Image!!!

    What does cap.read() return? What does cap.retrieve() return?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. do something while a button is pressed
    By saman_artorious in forum Qt Programming
    Replies: 11
    Last Post: 12th November 2013, 16:39
  2. Replies: 6
    Last Post: 4th October 2010, 04:19
  3. Video Parsing - Frame by Frame
    By ctote in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2010, 19:30
  4. To draw a circle on a frame when the key is pressed
    By soumya in forum Qt Programming
    Replies: 18
    Last Post: 9th February 2010, 11:21
  5. grab images from Phonon video
    By Kraut~salat in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2009, 10:53

Tags for this Thread

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.