boxfilter

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
 
Fast convolve (average) for uniform, rectangular masks.
 
Fast convolve (average) for uniform, rectangular masks.
 
|
 
|
Arguments: a numeric array, a box size and an ignore value
+
Arguments: any three dimensional numeric array, a two dimensional box size and an ignore value
 
   
 
   
 
Return Value: a float numeric array the x and y dimensios and organization of the original with convolved data.
 
Return Value: a float numeric array the x and y dimensios and organization of the original with convolved data.
Line 10: Line 10:
 
The size can be either a size in x and y defining a rectangle or a square of side length of 'size'.
 
The size can be either a size in x and y defining a rectangle or a square of side length of 'size'.
 
   
 
   
Pixels containing the ignore value will be filled in if they are within one half of a box length from a pixel that has a valid value.
+
Pixels containing the ignore value will be filled in with convolved values if they are within one half of a box length from a pixel that has a valid value.
 +
 +
boxfilter() will only convolve in the x-y plane.
 +
 +
You can specify either an x and y for rectangular windows, or just size for a square window.  Returns windowed average for all non-ignore pixels.
 +
If you specify verbose, it will return a structure containing the windowed mean, pixel count and standard deviation under the window (plus some other stuff for working with running sums).
 +
 +
Note: boxfilter() can use 24 bytes of memory per input pixel.  It uses a LOT of memory and may exceed RAM limits if used on large objects.  Use [[convolve]], [[thm.convolve]] or [[rboxfilter]] for large arrays.
 
|
 
|
 
   dv> a
 
   dv> a
Line 27: Line 34:
 
|
 
|
 
|
 
|
 +
*[[convolve]]
 +
*[[thm.convolve]]
 +
*[[filterx]]
 +
*[[filtery]]
 
|
 
|
 
|
 
|

Revision as of 15:52, 20 February 2006



64-bit SafeYes

Description

Fast convolve (average) for uniform, rectangular masks.

Arguments and Return Values

Arguments: any three dimensional numeric array, a two dimensional box size and an ignore value

Return Value: a float numeric array the x and y dimensios and organization of the original with convolved data.

Usage

Syntax: boxfilter(obj, size, ignore, verbose)

The size can be either a size in x and y defining a rectangle or a square of side length of 'size'.

Pixels containing the ignore value will be filled in with convolved values if they are within one half of a box length from a pixel that has a valid value.

boxfilter() will only convolve in the x-y plane.

You can specify either an x and y for rectangular windows, or just size for a square window. Returns windowed average for all non-ignore pixels. If you specify verbose, it will return a structure containing the windowed mean, pixel count and standard deviation under the window (plus some other stuff for working with running sums).

Note: boxfilter() can use 24 bytes of memory per input pixel. It uses a LOT of memory and may exceed RAM limits if used on large objects. Use convolve, thm.convolve or rboxfilter for large arrays.

Examples

 dv> a
 345x600x1 array of byte, bsq format [207,000 bytes]

 dv> bx=boxfilter(a,x=21,y=1,ignore=0)
 345x600x1 array of float, bsq format [828,000 bytes]

 dv> by=boxfilter(a,x=1,y=21,ignore=0)
 345x600x1 array of float, bsq format [828,000 bytes]

 dv> bboth=boxfilter(a,size=21,ignore=0)
 345x600x1 array of float, bsq format [828,000 bytes]

Images

bxfltpic1.png bxfltpic2.png bxfltpic3.png bxfltpic4.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools