AForge.NET

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

Output just motion detection

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

Output just motion detection

Postby maiam » Wed Feb 22, 2012 5:57 am

Hi there,

First of all, great software !

I'm helping some friends to set up an art gallery in which we will try monitoring the visitors movement and display it on screen. We don't need the actual camera footage but just the motion detection effect. I'm using the "grid processing" effect to achieve this. It's kind of an artistic twist rather than actual common use.

I've installed VS 2010, downloaded the source and successfully compiled. I've messed around with MotionDetector.cs, IMotiomProcessing.cs and GridMotionAreaProcessing.cs in AForge.Vision but can't find the right spot to make the changes.

Is there any way to achieve this ? I mean, hide the camera footage and just show the motion detection output ?

Btw, I'm a webdev. I understand programming but I'm not used to work with C# or even VS.

I'll be making a website for this art gallery and I would be delighted to add AForge to the credits if this works.

Thanks in advance !
maiam
 
Posts: 4
Joined: Wed Feb 22, 2012 5:41 am

Re: Output just motion detection

Postby andrew.kirillov » Wed Feb 22, 2012 6:12 am

Hello,

maiam wrote:we will try monitoring the visitors movement and display it on screen.

Not exactly sure what is meant by this ... You may just use some video source object and motion detector without any controls (like VideoSourcePlayer) which display video. Simply feed new video frames to motion detector in NewFrame event handler (see sample application) and then visualize something in the way you want it. You can visualize MotionFrame somehow or you may visualize MotionGrid, etc.

maiam wrote:I understand programming but I'm not used to work with C# or even VS.

Well, you will need to get use to it then ;)
With best regards,
Andrew


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

Re: Output just motion detection

Postby maiam » Wed Feb 22, 2012 5:00 pm

Thanks for the reply Andrew !

Forgot to mention I'm using iSpy. It is compiled with AForge.

I'll try to explain better myself. When motion detection is turned on, it is added to the video feed. In my case, when motion is detected, and because I'm using "grid processing", big red squares are added to the camera output.

What I'm trying to do is just using the squares (where motion is detected) but not the camera image itself. I need to separate it from those camera images which I don't need.

I believe creating a new blank unmanaged image and feeding it to the ProcessFrame function will suffice. But I'm clueless as where I have to do this.

Regarding VS, you're absolutely right and I'm getting used. It's like I can understand many things but I can't "talk" the language. Learning it takes time though. Meanwhile I have a couple of days to solve this issue and I feel it's going to be a big disappointment. Oh well ...

Thank you again !
maiam
 
Posts: 4
Joined: Wed Feb 22, 2012 5:41 am

Re: Output just motion detection

Postby maiam » Wed Feb 22, 2012 8:35 pm

Well, well. I have made some new achievments.

I edited GridMotionAreaProcessing.cs and created some conditions to set all the pixels without motion to black. The result, the camera output is all black but the motion objects. That's a good result for my objectives.

Now I have one last issue. The motion highlighted areas haven't a solid color. I still can see what's behind the highlighted areas. Is there any way to turn the highlight into a solid color instead of a transparency ?

Thanks !
maiam
 
Posts: 4
Joined: Wed Feb 22, 2012 5:41 am

Re: Output just motion detection

Postby andrew.kirillov » Wed Feb 22, 2012 8:40 pm

Check the code - the GridMotionAreaProcessing does not do anything about transparency. It just make a chessboard like grid.
With best regards,
Andrew


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

Re: Output just motion detection

Postby maiam » Thu Feb 23, 2012 12:55 am

Forgive my aging eyes ... It really seamed a transparency but it's indeed a checkerboard effect. :oops:

I just hit the nail. Deleting this piece of code "&& ((x + y) & 1 ) == 0" from the highlight condition inside GridMotionAreaProcessing removed the checkerboard effect.

Thanks for all the hints Andrew ! 8-)

LoL. The effect is very cool. Looks like "space invaders" or some other old 8 bit stuff. Ah ! :mrgreen:
maiam
 
Posts: 4
Joined: Wed Feb 22, 2012 5:41 am




Return to AForge.NET Framework

cron