ossimOpenCVSobelFilter Class Reference

OpenCV Sobel Filter. More...

#include <ossimOpenCVSobelFilter.h>

List of all members.

Public Member Functions

 ossimOpenCVSobelFilter (ossimObject *owner=NULL)
 ossimOpenCVSobelFilter (ossimImageSource *inputSource, int xorder=1, int yorder=1, int aperture_size=3)
 ossimOpenCVSobelFilter (ossimObject *owner, ossimImageSource *inputSource, int xorder=1, int yorder=1, int aperture_size=3)
ossimString getShortName () const
ossimString getLongName () const
virtual ossimRefPtr
< ossimImageData > 
getTile (const ossimIrect &tileRect, ossim_uint32 resLevel=0)
virtual void initialize ()
virtual ossimScalarType getOutputScalarType () const
ossim_uint32 getNumberOfOutputBands () const
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)

Protected Member Functions

void runUcharTransformation (ossimImageData *tile)

Protected Attributes

ossimRefPtr< ossimImageData > theTile
 Output tile.
int theXOrder
 Order of the derivative of x.
int theYOrder
 Order of the derivative of y.
int theApertureSize
 Size of the extended Soble kernel, must be 1, 3, 5 or 7.

Detailed Description

OpenCV Sobel Filter.

Calculates the first, second, third or mixed image derivatives using an extended Sobel operator.

Parameters:
xorder Order of the derivative x
yorder Order of the derivative y
aperture_size Size of the extended Sobel kernel, must be 1, 3, 5 or 7

In all cases except 1, an $ \texttt{apertureSize} \times \texttt{apertureSize} $ separable kernel will be used to calculate the derivative. For $ \texttt{apertureSize} = 1 $ a $ 3 \times 1 $ or $ 1 \times 3 $ a kernel is used (Gaussian smoothing is not done). There is also the special value CV_SCHARR (-1) that corresponds to a $ 3\times 3 $ Scharr filter that may give more accurate results than a $ 3\times 3 $ Sobel. Scharr aperture is

$ \vecthreethree {-3}{0}{3} {-10}{0}{10} {-3}{0}{3} $

for the x-derivative or transposed for the y-derivative.

The function calculates the image derivative by convolving the image with the appropriate kernel:

$ \texttt{dst}(x,y) = \frac{d^{xorder+yorder}}{dx^{xorder} \cdot dy^{yorder}} \texttt{src} $

The Sobel operators combine Gaussian smoothing and differentiation so the result is more or less resistant to the noise. Most often, the function is called with (xorder = 1, yorder = 0, apertureSize = 3) or (xorder = 0, yorder = 1, apertureSize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of:

$ \left[ \begin{array}{ccc} -1 & 0 & 1 \\ -2 & 0 & 2 \\ 1 & 2 & 1 \\ \end{array} \right] $

and the second one corresponds to a kernel of:

$ \left[ \begin{array}{ccc} -1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1 \\ \end{array} \right] $

or a kernel of:

$ \left[ \begin{array}{ccc} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \\ \end{array} \right] $

depending on the image origin (origin field of IplImage structure). Besides 8-bit images the function can process 32-bit floating-point images. Both the source and the destination must be single-channel images of equal size or equal ROI size.


Member Function Documentation

bool ossimOpenCVSobelFilter::loadState ( const ossimKeywordlist &  kwl,
const char *  prefix = 0 
) [virtual]

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.


The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on Thu May 13 09:23:33 2010 for opencv-ossim-plugin by  doxygen 1.6.1