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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:04:21+00:00 2026-05-16T23:04:21+00:00

I am applying common image transforms to my live webcam capture. I want to

  • 0

I am applying common image transforms to my live webcam capture. I want to display the original webcam in one window and the image with the transforms applied to in another window. However, I am getting same image (filtered) on both windows, I am wondering if I am limited by the OpenCV API or if I am missing something? My code snippet looks like –

/* allocate resources */
cvNamedWindow("Original", CV_WINDOW_AUTOSIZE);
cvNamedWindow("Filtered", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCaptureFromCAM(0);

do {    
    IplImage* img = cvQueryFrame(capture);
    cvShowImage("Original", img);           

    Filters* filters = new Filters(img);
    IplImage* dst = filters->doSobel();
    cvShowImage("Filtered", dst);

    cvWaitKey(10);      
} while (1);

/* deallocate resources */
cvDestroyWindow("Original");
cvDestroyWindow("Filtered");
cvReleaseCapture(&capture);
  • 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-16T23:04:22+00:00Added an answer on May 16, 2026 at 11:04 pm

    Its possible! Try copying img to another IplImage before sending it to processing and see if that works first.

    Yes, I know what you’re going to say. But just try that first and see if it does what you want. The code below is just to illustrate what you should do, I don’t know if it will work:

    /* allocate resources */
    cvNamedWindow("Original", CV_WINDOW_AUTOSIZE);
    cvNamedWindow("Filtered", CV_WINDOW_AUTOSIZE);
    CvCapture* capture = cvCaptureFromCAM(0);    
    
    do {    
        IplImage* img = cvQueryFrame(capture);
        cvShowImage("Original", img);           
    
        IplImage* img_cpy = cvCreateImage(cvGetSize(img), 8, 3);
        img_cpy = cvCloneImage(img);
    
        Filters* filters = new Filters(img_cpy);
        IplImage* dst = filters->doSobel();
        cvShowImage("Filtered", dst);
    
        /* Be aware that if you release img_cpy here it might not display 
         * the data on the window. On the other hand, not doing it now will
         * cause a memory leak.
         */
        //cvReleaseImage( &img_cpy );  
    
        cvWaitKey(10);      
    } while (1);
    
    /* deallocate resources */
    cvDestroyWindow("Original");
    cvDestroyWindow("Filtered");
    cvReleaseCapture(&capture);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When applying a Gaussian blur to an image, typically the sigma is a parameter
After applying CSS to one of my forms, some of the fields cannot be
After applying join condition on two tables I want records which is maximum among
I am applying regex on my window form using c#. but regular expression on
I don't know much about skins. I want to apply a common format for
When applying the MVP pattern to ASP.NET applications, where does using AJAX to post
My startup is considering applying for Microsoft BizSpark . I am unclear as to
I'm applying an XSLT stylesheet to the following XML file: <top xmlns=http://www.foo.com/bar> <elementA />
I'm applying the strikeout tag: <s>$5,000,000</s> But the line is too low.. .it's about
I am interested in applying dependency injection to my current project, which makes use

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.