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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:26:53+00:00 2026-06-06T00:26:53+00:00

Basically I need to capture the video from videocamera do some processing on frames

  • 0

Basically I need to capture the video from videocamera do some processing on frames and for each frame show a rectangle of detection.

Example: http://www.youtube.com/watch?v=aYd2kAN0Y20

How would you superimpose this rectangle on the output of videocamera (usb)? (c++)

  • 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-06T00:26:56+00:00Added an answer on June 6, 2026 at 12:26 am

    I would use OpenCV, an open source imaging library to get input from a webcam/video file.
    Here is a tutorial on how to install it:

    http://opensourcecollection.blogspot.com.es/2011/04/how-to-setup-opencv-22-in-codeblocks.html

    Then I would use this code:

    CvCapture *capture = cvCreateCameraCapture(-1);
    IplImage* frame = cvQueryFrame(capture);
    

    To get the image, frame from the CvCapture, capture.

    In this case, capture is taken directly from a video camera, but you can also create it from a video file with:
    CvCapture *capture = cvCreateFileCapture("filename.avi");

    Then, I would draw on the image with functions defined here: http://opencv.willowgarage.com/documentation/drawing_functions.html

    By the way, the shape in the Youtube video is not a rectangle. It’s a parallelogram.


    If you want to do it live, then you can basically put this in a loop, getting a frame, processing it, drawing on it, and then outputting the image, like this:

    You would include this before your loop:
    cvNamedWindow("Capture", CV_WINDOW_AUTOSIZE);

    And then, in your loop, you would say this:
    cvShowImage("Capture", frame);

    After the processing.


    EDIT To do this in C++, open your webcam like this:

    VideoCapture cap(0); // open the default camera
    if(!cap.isOpened())  // check if we succeeded
        return -1;
    

    To initialize it from a file, instead of putting in the camera index, put the file path.

    Get a frame from the camera like this:

     Mat frame;
     cap >> frame; // get a new frame from camera
    

    Then you can find drawing functions here:
    http://opencv.willowgarage.com/documentation/cpp/core_drawing_functions.html

    Cheers!

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

Sidebar

Related Questions

Context What we need is to capture some user input (formatted text) from a
Basically need to generate custom(some different then yes no) messeges(alert) in JS , how
So basically I need to make feature that if you select something from first
here is some code I've been working on, basically I need to set up
I got a RS232 signal capture device. and it working great. I need some
basically need to change the value that - admin_url() returns any idea?
I basically need to check if there is an easier way to do this
Basically I need to connect to the database without any existing databases. In SQL,
Basically I need to reset Identity Increment for all tables to its original. Here
Basically I need to setup my ASMX file so that when I pull it

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.