[Insight-developers] Erosion/Dilation Speed Tests

Miller, James V (Research) millerjv@crd.ge.com
Mon, 12 May 2003 11:12:40 -0400


I compared the implementations of the 
	itkObject[Erode|Dilate]MorphologyImageFilter
with 
	itkBinary[Erode|Dilate]ImageFilter

The Object* versions assume the center pixel of the structuring 
element is "on".  While in practise this is usually the case it is
not necessary in the general definition of the morphological 
operations.

Making this assumption, the (large) footprint of the structuring
element only has to be evaluated on the "object boundary". I haven't
run my Quantify tests yet, but that probably accounts for alot of 
its speed.  

If this is the real difference in speed (as opposed to searching the 
neighborhood for a replacement value), then we can probably merge 
the two implementations and use this optimization when the center
pixel of the structuring element is on.

I'll still run the Quantify tests and see if I can merge the two
approaches.

Jim



> -----Original Message-----
> From: Stephen R. Aylward [mailto:aylward@unc.edu]
> Sent: Sunday, May 11, 2003 2:01 PM
> To: Insight-Developers (E-mail)
> Subject: [Insight-developers] Erosion/Dilation Speed Tests
> 
> 
> Hi,
> 
> I ran some speed tests to compare
> 	itkObject[Erode|Dilate]MophologyImageFilter
> with
> 	itkBinary[Erode|Dilate]ImageFilter
> 
> These tests are contained in 
> Insight/Testing/Code/BasicFilters/itkObjectMophologyImageFilterTest
> 
> Data: 50x50x50, unsigned short image
> 
> Windows 2000 - compiled in MSVC++6 with RelWithDebInfo mode.
> 
> 		Pentium 4		Dual Pentium Xeon
> 		Avg Time (sec)		Avg Time (sec)
> ObjectDilate	0.425			0.14
> BinaryDilate	12.37			4.10
> 
> ObjectErode	0.035			0.015
> BinaryErode	0.130			0.047
> 
> So, for Dilation the speedup is ~30x and for erosion the 
> speedup is ~4x. 
>    This puts ITK as
> 
> Note that ObjectErode is not a 100% compatible implementation of 
> erosion.   You actually need to use (radius-1) for the ObjectErosion 
> filter to get the same result as with BinaryErosion - I did 
> not do that 
> in the above tests - so ObjectErode is actually faster than reported.
> 
> What about swapping the names of these two filters?   The 
> ObjectDilate/Erode filters assumes there are fixed (user specified) 
> foreground and background values.   The BinaryDilate/Erode filters 
> perform tests on adjacent pixels to determine what value with 
> which to 
> fill a dilation/erosion.
> 
> Stephen
> 
> -- 
> ===============================================
> Dr. Stephen R. Aylward
> Assistant Professor of Radiology
> Adjunct Assistant Professor of Computer Science
> http://caddlab.rad.unc.edu
> aylward@unc.edu
> (919) 966-9695
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>