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

  • Home
  • SEARCH
  • 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 6812521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:27:33+00:00 2026-05-26T20:27:33+00:00

The big problem lies in the fact that the code, no matter which number

  • 0

The big problem lies in the fact that the code, no matter which number I type in to VideoCapture cap(), it will always find the internal webcap of my laptop – Or die trying.
I have tried going in to devices and deactivated the internal one, but
it did little good.
(By the way, I’m new at this forum, so be gentle.)

Here’s the code ( Not including the Rotation function.)

int main()
{   
    // NOW WITH WEBCAM INPUT!!
    VideoCapture cap(0);//capture image from webcam
    cap.open(true); 
    Mat image;
    cap>>image; //applying the captured image to Mat image
    //Mat image = imread("Tulips.jpg"); // reading the image
    double degrees; // Number of degrees we want to rotate the image
    double oregoX = image.cols / 2; //X-center of the image
    double oregoY = image.rows / 2; //Y-center of the image

    //user inputs
    cout << "please enter the number of degrees you wish to turn the image" << endl;
    cin >> degrees;

    cout << "\n\nplease enter at which point (X, Y) you want to rotate the image\n(make space not comma)\n" << endl;
    cout << "The center of the image is at " << oregoX << ", " << oregoY << endl;
    cin >> oregoX >> oregoY;

    while (true){
        cap>>image;

        if (!image.data) break;
        if (waitKey(30) >= 0) break;

        cvtColor(image, image, CV_8U); //Converting image to 8-bit
        Mat grayImage; //creating a canvas for the grayscale image
        cvtColor(image, grayImage, CV_RGB2GRAY); //creating the grayscale image

        // Here we create a canvas with the same size as the input image, later to put in the rotated data
        Mat imageOut(grayImage.rows, grayImage.cols, CV_8U);

        Rotation(grayImage, imageOut, degrees, oregoX, oregoY); //Performing the rotation on the image using the Rotation() funcion

        imshow("The Gray Image", grayImage);
        imshow("The rotated image", imageOut);

    }
}
  • 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-26T20:27:34+00:00Added an answer on May 26, 2026 at 8:27 pm

    Device manager -> Locate internal webcam -> Disable internal webcam.
    The default webcam will then become whichever webcam that you plug in
    afterwards.

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

Sidebar

Related Questions

My code doesn't compile. It seems that the problem lies in the main function
Big problem. I'm not sure what it was that I did, but it seems
I have a big problem. I want to extract text from html table that
I have a (big) problem that all of you that work with Webforms might
I've got a big problem with IBM HACL for accessing a server which speaks
I'm having a big problem trying to do map an entity to another that
It's always a big problem for web designers to make their page look good
I have a very big problem and can't seem to find anybody else on
I have a big problem with this code and I have no idea how
I have this big problem that i dont know how to fix. I have

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.