Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:30:53+00:00 2026-06-16T13:30:53+00:00

I have a vector of type cvMat into which I have been storing frames

  • 0

I have a vector of type cvMat into which I have been storing frames taken from my computer’s webcam. After storing 100 frames, I would like to play the frames back. If record is my vector of cvMats, I thought this might be done as so:

cvNamedWindow("play-back",CV_WINDOW_AUTOSIZE);
cvMoveWindow("play-back",100,100);
for (vector<Mat>::iterator iter = record.begin(); iter != record.end();++iter) {
   imshow("play-back",*iter);
}

When executed, the program seems to work well enough for storing the cvMats and getting input from the webcam, but when I attempt to get playback, the program seems to execute that portion of code very quickly — so quickly, in fact, that I don’t have time to appreciate the results. How might I be able to improve this code so that the playback is not so rushed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:30:55+00:00Added an answer on June 16, 2026 at 1:30 pm

    You need to give control to OpenCV to actually render each image in the window and hold it for a brief period of time before switching to the next. You should add a call to cvWaitKey with a delay of, say 41ms (approximately 24 fps). Then you can check cvWaitKey’s return value so that the user can stop the playback. Something like this:

    cvNamedWindow("play-back",CV_WINDOW_AUTOSIZE);
    cvMoveWindow("play-back",100,100);
    for (vector<Mat>::iterator iter = record.begin(); iter != record.end();++iter) {
       imshow("play-back",*iter);
       if( cvWaitKey(41) == 27 ) // ESC
           break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, In C++, I have a vector of type: vector<BaseClass*> myVector; In which, I
I have the vector d<-1:100 I want to sample k=3 times from this vector
I have a class called SparseMatrix which contain a private vector of type Cell.
I have a vector called actorVector which stores an array of objects of type
I have a vector with type const std::vector<const Array*> &objects which is passed as
I have a vector that holds pointers to abstract type Rock : vector<Rock*> rocks;
I have a vector of pairs representing hops between nodes which I would like
It may be a bit confusing, but... Let's say I have a vector type
I have a Vector of Object[] type that stores my data. How to print
I have a global matrix (type vector< vector< char> > ) and I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.