VideoInput and OpenCV

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

VideoInput and OpenCV

bernd_kr
Hi,

I'm not the best programmer, so please don't be mad at me if this
question is a little bit dumb...

I have tried to write a little programm where I get a videostream from
my webcam. So I used highgui and this worked perfectly good, but with
OpenCV I can't change the resolution and the fps of the stream (the
program is for windows).
So I made a little research on the internet and found the VideoInput
libary.

So my problem is how to use the VideoInput libary with opencv.

I tried just to put...

videoInput VI;
int device1 = 0;
VI.setupDevice(device1, 320, 240);

... before the other code, but that doesn't work. The image stays
black and the size of the window doesn't change.

I hope somebody can help me with my problem.

Thank you in advance.

Bernd

Reply | Threaded
Open this post in threaded view
|

Re: VideoInput and OpenCV

Peter Eisenlohr
bernd_kr schrieb:

> I have tried to write a little programm where I get a videostream from
> my webcam. So I used highgui and this worked perfectly good, but with
> OpenCV I can't change the resolution and the fps of the stream (the
> program is for windows).
> So I made a little research on the internet and found the VideoInput
> libary.
>
> So my problem is how to use the VideoInput libary with opencv.
>
> I tried just to put...
>
> videoInput VI;
> int device1 = 0;
> VI.setupDevice(device1, 320, 240);
>
> ... before the other code, but that doesn't work. The image stays
> black and the size of the window doesn't change.

You need to make some sort of connection between the videoInput library
and OpenCV. The three lines of code above just start capturing, but
videoInput does not know yet where to put the image data.

For this, you need to use the isFrameNew() and getPixels() functions of
videoInput.

if (VI.isFrameNew(device1))
  VI.getPixels(device1, (unsigned char *)img->imageData, true, true);

You need to call this code regularly, i.e. within a timer. 'img' is an
OpenCV image of appropriate size and format:

  IplImage *img = cvCreateImage(cvSize(320, 240), 8, 3);

Hope this helps getting you started... I have been using videoInput
library for some time now, and it works almost perfectly.

  Peter


















>
> I hope somebody can help me with my problem.
>
> Thank you in advance.
>
> Bernd
>
>

Reply | Threaded
Open this post in threaded view
|

Re: VideoInput and OpenCV

chjm8569
--- In [hidden email], Peter Eisenlohr <p.eisenlohr@...>
wrote:
>
> bernd_kr schrieb:
> > I have tried to write a little programm where I get a videostream
from
> > my webcam. So I used highgui and this worked perfectly good, but
with
> > OpenCV I can't change the resolution and the fps of the stream
(the
> > program is for windows).
> > So I made a little research on the internet and found the
VideoInput

> > libary.
> >
> > So my problem is how to use the VideoInput libary with opencv.
> >
> > I tried just to put...
> >
> > videoInput VI;
> > int device1 = 0;
> > VI.setupDevice(device1, 320, 240);
> >
> > ... before the other code, but that doesn't work. The image stays
> > black and the size of the window doesn't change.
>
> You need to make some sort of connection between the videoInput
library
> and OpenCV. The three lines of code above just start capturing, but
> videoInput does not know yet where to put the image data.
>
> For this, you need to use the isFrameNew() and getPixels() functions
of
> videoInput.
>
> if (VI.isFrameNew(device1))
>   VI.getPixels(device1, (unsigned char *)img->imageData, true,
true);
>
> You need to call this code regularly, i.e. within a timer. 'img' is
an
> OpenCV image of appropriate size and format:
>
>   IplImage *img = cvCreateImage(cvSize(320, 240), 8, 3);
>
> Hope this helps getting you started... I have been using videoInput
> library for some time now, and it works almost perfectly.
>
  Hi, Peter,
  I am so excited to know that videoInput really works for the purpose
of capturing from camera. For me, when I tried to overcame the
capturing problem, I found that there were just too little available
information on using videoInput.
  Would you mind to give some detail on how to use it? I am using
VC6.0, what's your working environment? Does the version of the
compiler affect the usage of videoInput?
  Thanks in advance.
  Jianming

>   Peter
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
> > I hope somebody can help me with my problem.
> >
> > Thank you in advance.
> >
> > Bernd
> >
> >
>



Reply | Threaded
Open this post in threaded view
|

Re: Re: VideoInput and OpenCV

Danika Sleeger
Hi,
 
I'm looking for info as well.
However my first tests seems to suggest that VideoInput is simply buried inside the old cvCapture constructs. That might be why now capturing from two cameras works fine (it ued not to work on my setup with 1.0).
 
The downsde is that SET_FPS is broken right now.
 
Can some of the deveopers shed some light on this? It would be very useful!
 
Franco

--- On Tue, 1/6/09, chjm8569 <[hidden email]> wrote:

From: chjm8569 <[hidden email]>
Subject: [OpenCV] Re: VideoInput and OpenCV
To: [hidden email]
Date: Tuesday, January 6, 2009, 7:02 PM






--- In OpenCV@yahoogroups. com, Peter Eisenlohr <p.eisenlohr@ ...>
wrote:
>
> bernd_kr schrieb:
> > I have tried to write a little programm where I get a videostream
from
> > my webcam. So I used highgui and this worked perfectly good, but
with
> > OpenCV I can't change the resolution and the fps of the stream
(the
> > program is for windows).
> > So I made a little research on the internet and found the
VideoInput

> > libary.
> >
> > So my problem is how to use the VideoInput libary with opencv.
> >
> > I tried just to put...
> >
> > videoInput VI;
> > int device1 = 0;
> > VI.setupDevice( device1, 320, 240);
> >
> > ... before the other code, but that doesn't work. The image stays
> > black and the size of the window doesn't change.
>
> You need to make some sort of connection between the videoInput
library
> and OpenCV. The three lines of code above just start capturing, but
> videoInput does not know yet where to put the image data.
>
> For this, you need to use the isFrameNew() and getPixels() functions
of
> videoInput.
>
> if (VI.isFrameNew( device1))
> VI.getPixels( device1, (unsigned char *)img->imageData, true,
true);
>
> You need to call this code regularly, i.e. within a timer. 'img' is
an
> OpenCV image of appropriate size and format:
>
> IplImage *img = cvCreateImage( cvSize(320, 240), 8, 3);
>
> Hope this helps getting you started... I have been using videoInput
> library for some time now, and it works almost perfectly.
>
Hi, Peter,
I am so excited to know that videoInput really works for the purpose
of capturing from camera. For me, when I tried to overcame the
capturing problem, I found that there were just too little available
information on using videoInput.
Would you mind to give some detail on how to use it? I am using
VC6.0, what's your working environment? Does the version of the
compiler affect the usage of videoInput?
Thanks in advance.
Jianming

> Peter
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
> > I hope somebody can help me with my problem.
> >
> > Thank you in advance.
> >
> > Bernd
> >
> >
>

 














     

[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: Re: VideoInput and OpenCV

Peter Eisenlohr
Danika Sleeger wrote:
> I'm looking for info as well.
> However my first tests seems to suggest that VideoInput is simply buried
> inside the old cvCapture constructs. That might be why now capturing
> from two cameras works fine (it ued not to work on my setup with 1.0).
>  
> The downsde is that SET_FPS is broken right now.
>  
> Can some of the deveopers shed some light on this? It would be very useful!

I've also heard that videoInput is being used inside OpenCV now, but
have not tried it yet. Instead, I managed to compile videoInput myself,
although I'm using Visual C++ 2008 (Express Edition). Compiling
videoInput is a little troublesome, since you need to download DX9SDK
(yes, the old one) as well as a current Platform SDK. If I can find some
time, maybe I'll put up a tutorial.

With this videoInput library, capturing from multiple cameras works
fine. I don't know about setting FPS, though.

  Peter
Reply | Threaded
Open this post in threaded view
|

Re: VideoInput and OpenCV

mdale9_opencv
Guys

There is a newer version of VideoInput available (0.1993) than the one
packaged with OpenCV 1.1 (0.1991) which states that the frame rate is
selectable.

See here for details
http://tech.groups.yahoo.com/group/OpenCV/message/58884


Martin
--- In [hidden email], Peter Eisenlohr <p.eisenlohr@...> wrote:
>
> Danika Sleeger wrote:
> > I'm looking for info as well.
> > However my first tests seems to suggest that VideoInput is simply
buried
> > inside the old cvCapture constructs. That might be why now capturing
> > from two cameras works fine (it ued not to work on my setup with 1.0).
> >  
> > The downsde is that SET_FPS is broken right now.
> >  
> > Can some of the deveopers shed some light on this? It would be
very useful!

>
> I've also heard that videoInput is being used inside OpenCV now, but
> have not tried it yet. Instead, I managed to compile videoInput myself,
> although I'm using Visual C++ 2008 (Express Edition). Compiling
> videoInput is a little troublesome, since you need to download DX9SDK
> (yes, the old one) as well as a current Platform SDK. If I can find some
> time, maybe I'll put up a tutorial.
>
> With this videoInput library, capturing from multiple cameras works
> fine. I don't know about setting FPS, though.
>
>   Peter
>


Reply | Threaded
Open this post in threaded view
|

Re: Re: VideoInput and OpenCV

Theodore Watson
Hi Martin, OpenCV group,

I am Theo Watson the developer of videoInput - I am glad you found the
0.1993 release which does allow you to set frame rate. I hadn't made it
public yet as it needs one very small bug fix but 0.1994 which I will put
together next week is basically identical to it and that will be a public
release. Definitely check out the 0.1993 release and let me know if you (or
anyone else in this group) have any feedback. There is some other new
functionality like the ability to change the driver's capture settings in
code.

If anyone else is after the link it is here:
http://muonics.net/school/spring05/videoInput/files/videoInput0.1993.zip

All the best,
Theo

On 9/1/09 04:18, "mdale9_opencv" <[hidden email]> wrote:

> Guys
>
> There is a newer version of VideoInput available (0.1993) than the one
> packaged with OpenCV 1.1 (0.1991) which states that the frame rate is
> selectable.
>
> See here for details
> http://tech.groups.yahoo.com/group/OpenCV/message/58884
>
>
> Martin
> --- In [hidden email], Peter Eisenlohr <p.eisenlohr@...> wrote:
>>
>> Danika Sleeger wrote:
>>> I'm looking for info as well.
>>> However my first tests seems to suggest that VideoInput is simply
> buried
>>> inside the old cvCapture constructs. That might be why now capturing
>>> from two cameras works fine (it ued not to work on my setup with 1.0).
>>>  
>>> The downsde is that SET_FPS is broken right now.
>>>  
>>> Can some of the deveopers shed some light on this? It would be
> very useful!
>>
>> I've also heard that videoInput is being used inside OpenCV now, but
>> have not tried it yet. Instead, I managed to compile videoInput myself,
>> although I'm using Visual C++ 2008 (Express Edition). Compiling
>> videoInput is a little troublesome, since you need to download DX9SDK
>> (yes, the old one) as well as a current Platform SDK. If I can find some
>> time, maybe I'll put up a tutorial.
>>
>> With this videoInput library, capturing from multiple cameras works
>> fine. I don't know about setting FPS, though.
>>
>>   Peter
>>
>
>