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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:35:35+00:00 2026-06-14T19:35:35+00:00

I want to take single frames from a Logitech C300 webcam using openCV. When

  • 0

I want to take single frames from a Logitech C300 webcam using openCV. When I use the code below. Images are saved but, in about 50% of the cases they contain errors (see image).

I now have been searching for hours, but as I don’t know what is causing it, I’m not sure which keyword may help for searching. For me it looks as if the image from the webcam is read while the camera is still updating the frame (but’s just a guess). I tested uvccapture which produces the same problems (but less often) with standard options, but works without problems when using the -m option. According to the man-page it’s “Toggles capture mode to YUYV capture”.

So my question is, is there a way to use this mode with openCV too? I would like to avoid using v4l2 directly.

VideoCapture cap(0);
if(!cap.isOpened())
cout << "Opening video device failed" << endl;
cap.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1024);
Mat frame;
for(int i = 0; i<50; i++)

{
    stringstream str;
    str << "/home/ubuntu/image" << i<< ".jpg";
    cap >> frame;
    imwrite(str.str(), frame);
    cout << i << endl;
}

return 0;
  • 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-14T19:35:36+00:00Added an answer on June 14, 2026 at 7:35 pm

    I found another thread here which states that the implementation of how the frames are captured by openCV may be the culprit:

    OpenCV calls on video-4-linux (v4l2) to request RGB frames from the camera. My camera was delivering JPEG compressed images which v4l2 was decompressing using a very slow software decoder.

    I am using a BeagleBoard and when using the (convenient) openCV-functions I had the mentioned problems. I tried the program Martin Fox linked in the thread, which takes YUV-frames from the webcam directly with v4l2. Now it is possible to get pictures up to 1280×1024 pixels without problems what is the resolution of the webcam’s sensor.

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

Sidebar

Related Questions

I confused when i want to take single pointer and when should i take
I want to take backup or restore of my oracle database through .Net code.
I want to take advantage of the new features in Windows 7 using C#
I want to take an array and use that array's values to populate an
Using Javascript, I want to take the content of a string and wrap every
I want to take daily backup of my DB for that I use following
I have a piece of code which allows me to take a single string
I have a question regarding data frames in R. I want to take a
Using Delphi 7, I have several functions that take a single integer parameter. These
I'm trying to use RazorGenerator as an email template engine. I want to take

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.