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 6549143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:03:25+00:00 2026-05-25T12:03:25+00:00

If i do: while(1) { //retrieve image from the camera webCamImage=cvQueryFrame(camera) // where ‘camera’

  • 0

If i do:

while(1) { 
   //retrieve image from the camera
   webCamImage=cvQueryFrame(camera) // where 'camera' is cvCreateCameraCapture(0)

   //do some heavy processing on the image that may take around half a second
   funcA()
}

Now when I go to consecutive iterations, it seems that webCamImage lags !

Even if i move the camera, webCamImage takes long time to get updated to the new field of view, and it keeps showing and processing previous field of view camera frames.

I am assuming that cvQuery has some buffer that retrieves the frames.

Can you please advise me on how to get the updated camera view each iteration ?

Many thanks

  • 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-05-25T12:03:25+00:00Added an answer on May 25, 2026 at 12:03 pm

    cvQueryFrame is just a wrapper that calls 2 other functions: cvGrabFrame, which gets data from the camera very quickly, and cvRetrieveFrame, which uncompresses this data and puts it into an IplImage. If you need frames captured immediately, just grab the frame, and retrieve it for processing later.

    See http://opencv.jp/opencv-1.0.0_org/docs/ref/opencvref_highgui.htm FMI

    Having said that, though, I use cvQueryFrame with a typical webcam, and I have no trouble getting dozens of frames per second. Any chance that the part that’s lagging is actually in your funcA() call? edit: from the comment in your code, I see that funcA() is indeed the slow part. If it takes half a second to execute, you’ll only get a new frame from cvQUeryFrame every half second, just as you describe. Try either making funcA faster, or put it in a separate thread.

    and as a friendly reminder, the IplImage returned by cvQueryFrame/cvRetrieveFrame should not be modified or deleted by the user; it’s part of OpenCV’s internal system for storing things, and if you’re doing anything interesting with it, you should make a copy. I don’t know if you’re doing this already, but I certainly did it wrong when I started out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following code to retrieve image from the phone or SDCard and
In my iPhone App I want to retrieve image from (stored in ) sqlite
I'm working on an app that can retrieve images from the web. Rather than
I have a service that i retrieve 7 URL's. Oncei retrieve the URLs from
While going through university and from following the development of SO, I've heard a
What i want to do: delete an image file from the private internal storage
I am using JDateChooser from here However I can not retrieve the date in
The Documentation of OpenCV mentions that the returned image (by cvRetrieveFrame) should not be
Im trying to read in image file from a server , with the code
Possible Duplicate: How to retrieve and display images from a database in a JSP

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.