AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

How to write motion detection in VB.NET (VS 2008)?

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

How to write motion detection in VB.NET (VS 2008)?

Postby snk » Wed Feb 04, 2009 9:10 am

How to write motion detection in VB.NET (VS 2008)?

I would like to implement motion detection and hand gestures function in my application in VB.NET.

But I don't know how to do it using Aforge.


Can you provide a tutorial on using Aforge.NET to implement above function?

Also, I would like to ask how to stream the webcam video to a website so that I can view my home Webcam in office?

Thanks.
snk
 
Posts: 10
Joined: Wed Feb 04, 2009 9:05 am

Re: How to write motion detection in VB.NET (VS 2008)?

Postby snk » Wed Feb 04, 2009 9:13 am

By the way, when will Aforge 2.0 will be released?

And how to display the webcam video in VB.NET? Which control should I use and how to do it?

Sorry to ask so many questions but I am newbie in VB.NET.

Thanks again.
snk
 
Posts: 10
Joined: Wed Feb 04, 2009 9:05 am

Re: How to write motion detection in VB.NET (VS 2008)?

Postby andrew.kirillov » Wed Feb 04, 2009 10:40 am

Hello,

snk wrote:How to write motion detection in VB.NET (VS 2008)?


Since you use VB.NET, you may add reference any .NET assembly in your application. So the first part you need to do is to reference AForge.NET assemblies, which are required for motion detection (AForge.Vision, AForge.Imaging, etc.). Then you need to start using motion detection classes, for example CountingMotionDetector. You don't need to write any motion detection code on your own. Just feed new video frame to motion detector and it will analyze them and let you know if there is motion detected or not.

snk wrote:But I don't know how to do it using Aforge.


You are welcome to study AForge.NET samples. Take a look at Motion Detection sample.

snk wrote:Also, I would like to ask how to stream the webcam video to a website so that I can view my home Webcam in office?


You may try using Microsoft Media Server, which is part of Windows Media Services.

With best regards,
Andrew
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2734
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: How to write motion detection in VB.NET (VS 2008)?

Postby andrew.kirillov » Wed Feb 04, 2009 10:49 am

snk wrote:By the way, when will Aforge 2.0 will be released?


The date for 2.0 release is not yet set. Most probably a beta will appear before (hope soon). Which particular features are you interested in 2.0?

In the meantime you may use 1.7.0 version, which is available. Also 2.0 branch is open, so if you really need to try something from there, then it is possible to check out it and build it.

snk wrote:And how to display the webcam video in VB.NET? Which control should I use and how to do it?


In 1.7.0 version you may use VideoCaptureDevice class, which provides frames from your web camera, and then you will need to render them. 2.0 version will simplify things a lot and in addition to the above class it will provide VideoSourcePlayer control, which will do all work for you.

With best regards,
Andrew
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2734
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: How to write motion detection in VB.NET (VS 2008)?

Postby snk » Wed Feb 04, 2009 12:43 pm

andrew.kirillov wrote:Hello,

snk wrote:How to write motion detection in VB.NET (VS 2008)?


Since you use VB.NET, you may add reference any .NET assembly in your application. So the first part you need to do is to reference AForge.NET assemblies, which are required for motion detection (AForge.Vision, AForge.Imaging, etc.). Then you need to start using motion detection classes, for example CountingMotionDetector. You don't need to write any motion detection code on your own. Just feed new video frame to motion detector and it will analyze them and let you know if there is motion detected or not.

snk wrote:But I don't know how to do it using Aforge.


You are welcome to study AForge.NET samples. Take a look at Motion Detection sample.

snk wrote:Also, I would like to ask how to stream the webcam video to a website so that I can view my home Webcam in office?


You may try using Microsoft Media Server, which is part of Windows Media Services.

With best regards,
Andrew


Thanks for your reply. I will give it a try.
But I would like to write my own application to stream the webcam video to a website so that I can view my home Webcam in office. Are there any classes in Aforge to help me?

Thanks.
snk
 
Posts: 10
Joined: Wed Feb 04, 2009 9:05 am

Re: How to write motion detection in VB.NET (VS 2008)?

Postby andrew.kirillov » Wed Feb 04, 2009 12:59 pm

snk wrote:But I would like to write my own application to stream the webcam video to a website so that I can view my home Webcam in office. Are there any classes in Aforge to help me?


Well, this may not be a simple application. You will need to deal with video stream compression, network streaming, etc. The simplest streamer in implementation could use MJPEG format. I do remember one AForge.NET user, who actually implemented that to see his home web camera.

No, AForge.NET does not provide anything to stream video to network. That was not the aim so far.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2734
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: How to write motion detection in VB.NET (VS 2008)?

Postby snk » Wed Feb 04, 2009 2:18 pm

andrew.kirillov wrote:
snk wrote:But I would like to write my own application to stream the webcam video to a website so that I can view my home Webcam in office. Are there any classes in Aforge to help me?


Well, this may not be a simple application. You will need to deal with video stream compression, network streaming, etc. The simplest streamer in implementation could use MJPEG format. I do remember one AForge.NET user, who actually implemented that to see his home web camera.

No, AForge.NET does not provide anything to stream video to network. That was not the aim so far.

Are there any example or tutorial to do that?
Is the member posted the source?

Thanks
snk
 
Posts: 10
Joined: Wed Feb 04, 2009 9:05 am

Re: How to write motion detection in VB.NET (VS 2008)?

Postby snk » Wed Feb 04, 2009 2:22 pm

andrew.kirillov wrote:
snk wrote:By the way, when will Aforge 2.0 will be released?


The date for 2.0 release is not yet set. Most probably a beta will appear before (hope soon). Which particular features are you interested in 2.0?


In the meantime you may use 1.7.0 version, which is available. Also 2.0 branch is open, so if you really need to try something from there, then it is possible to check out it and build it.

snk wrote:And how to display the webcam video in VB.NET? Which control should I use and how to do it?


In 1.7.0 version you may use VideoCaptureDevice class, which provides frames from your web camera, and then you will need to render them. 2.0 version will simplify things a lot and in addition to the above class it will provide VideoSourcePlayer control, which will do all work for you.

With best regards,
Andrew



I am interested in the videoSourceplayer function. However, when I draw somethings using videoSourcePlayer.createGraphics on to the VideoSourePlayer Control in VB.

The text on the VideoSourePlayer Control keep flashing.
snk
 
Posts: 10
Joined: Wed Feb 04, 2009 9:05 am

Re: How to write motion detection in VB.NET (VS 2008)?

Postby lzh » Thu May 14, 2009 8:55 am

Hi ,

Is the Aforge.net library able to records detected objects as in frame by frames and auto convert to avi/wma file?

e.g When motion detection is activated, is there a way to record each of individual frames into avi/wma or other standard video format?


Best Regards,
Han
lzh
 
Posts: 1
Joined: Thu May 14, 2009 2:54 am
Location: Singapore

Re: How to write motion detection in VB.NET (VS 2008)?

Postby andrew.kirillov » Thu May 14, 2009 9:57 am

Most of such questions could be eliminated by going briefly through the features list ...

Check AVIWriter which can be used to write AVI files.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 2734
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to AForge.NET Framework