AForge.NET

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

Which one is faster ?

The forum is to discuss topics related to different areas of image processing and computer vision.

Which one is faster ?

Postby mds » Thu Mar 26, 2009 10:10 am

Hello everybody.
I need to reach maximum speed in process .
I want to know which one is faster ?
FiltersSequence or Filter by Filter

For example :
Code: Select all
FiltersSequence filterSequence = new FiltersSequence(
                                    new GrayscaleBT709(),
                                    new Threshold(50),
                                    new Dilatation());


Or
Code: Select all
GrayscaleBT709 f1 = new GrayscaleBT709();
Threshold f2 = new Threshold(50);
Dilatation f3 = new Dilatation();


Thank you.
mds
 
Posts: 15
Joined: Mon Mar 23, 2009 1:57 pm

Re: Which one is faster ?

Postby andrew.kirillov » Thu Mar 26, 2009 12:34 pm

Hello,

The FiltersSequence is nice for quick tests, but not for the best performance. But, if you don't know how to use individual filters efficiently, then there is no difference. In order to get max performance, you need to minimize amount of locks/unlocks. This means you need to minimize amount of filters using Bitmap class. It is better to do one manual lock and then pass BitmapData to filter. There is also UnamangedImage class, which does not require locking/unlocking at all. Unmanaged images are supported now (in 2.0 beta) by all routines.
With best regards,
Andrew


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

Re: Which one is faster ?

Postby mds » Thu Mar 26, 2009 12:41 pm

There is also UnamangedImage class, which does not require locking/unlocking at all. Unmanaged images are supported now (in 2.0 beta) by all routines.


I'm using NewFrame event.
Code: Select all
void videoSourcePlayer_NewFrame(object sender, ref Bitmap image)
{
  .
  .
  .
}

So , Should I create an UnamangedImage type with ref Bitmap image ? or there isn't a difference !
mds
 
Posts: 15
Joined: Mon Mar 23, 2009 1:57 pm




Return to Image Processing and Computer Vision