space_invader2
space_invader2

Reputation: 1

GTKMM/GTK+/GLADE how to load video from webcam?

so I'm trying to create a GUI with gtk and glade and a I need to capture the video from my webcam . I have no idea how to do that or even if it's possible. Can somebody help me?


Update from probable OP:

It's Linux! Thanks but I switched to Qt it's user friendlier :)

Still, I have a problem now integrating opencv. I tried to implement a simple GUI in qt in which I press a button and load an image in a separate cvWindow.

I followed the simple tutorials on other forums but though it opens a cvWindow, it doesn't display the image.

Here is the source code:

widget::widget(QWidget *parent)
{
     setupUi(this);
      //setGeometry(100,100,512,512);
     connect( b, SIGNAL( clicked() ), this, SLOT( imshow()) );

}

void widget::imshow()
{

    img=cvLoadImage("/home/vladutzee/Desktop/boo.gif",CV_WINDOW_AUTOSIZE);
   cvNamedWindow("window",1);
    cvShowImage("window",img);
    cvWaitKey(10);
    cvDestroyWindow("window");
    cvReleaseImage( &img );
}

Upvotes: 0

Views: 1330

Answers (2)

liberforce
liberforce

Reputation: 11454

Which platform ? Windows, Linux, other ? Libcheese can do the trick, but AFAIK it doesn't work on Windows.

Upvotes: 0

Delan Azabani
Delan Azabani

Reputation: 81472

You could use libcheese, the library used as the foundation for the GTK+-based, simple webcam software, Cheese.

Upvotes: 1

Related Questions