dlr::computerVision Namespace Reference

This namespace is still in the early stages of development. More...


Classes

class  ColorspaceConverter
class  Image
 This class template represents a 2D image. More...
class  ImageFormatTraits
 The ImageFormatTraits class template specifies the characteristics of the available image formats. More...
class  ImageFormatTraits< GRAY1 >
class  ImageFormatTraits< GRAY8 >
class  ImageFormatTraits< GRAY16 >
class  ImageFormatTraits< GRAY32 >
class  ImageFormatTraits< GRAY64 >
class  ImageFormatTraits< GRAY_SIGNED16 >
class  ImageFormatTraits< GRAY_SIGNED32 >
class  ImageFormatTraits< GRAY_FLOAT32 >
class  ImageFormatTraits< GRAY_FLOAT64 >
class  ImageFormatTraits< RGB8 >
class  ImageFormatTraits< RGB16 >
class  ImageFormatTraits< RGB_SIGNED16 >
class  ImageFormatTraits< RGB_SIGNED32 >
class  ImageFormatTraits< RGB_FLOAT32 >
class  ImageFormatTraits< RGB_FLOAT64 >
class  ImageFormatTraits< HSV_FLOAT64 >
class  ImageFormatTraits< RGBA8 >
class  ImageFormatTraits< BGRA8 >
class  Kernel
 This class template represents a 2D convolution kernel. More...
class  Snake
class  OpticalFlow
 This class uses the method of Lucas and Kanade[1] to estimate the optical flow between two images. More...
struct  PixelBGRA
struct  PixelHSV
struct  PixelRGB
struct  PixelRGBA

Typedefs

typedef PixelBGRA< UnsignedInt8 > PixelBGRA8
typedef PixelBGRA< UnsignedInt16 > PixelBGRA16
typedef PixelBGRA< Int16 > PixelBGRASigned16
typedef PixelBGRA< Int32 > PixelBGRASigned32
typedef PixelBGRA< Float32 > PixelBGRAFloat32
typedef PixelBGRA< Float64 > PixelBGRAFloat64
typedef PixelHSV< UnsignedInt8 > PixelHSV8
typedef PixelHSV< UnsignedInt16 > PixelHSV16
typedef PixelHSV< Int16 > PixelHSVSigned16
typedef PixelHSV< Int32 > PixelHSVSigned32
typedef PixelHSV< Float32 > PixelHSVFloat32
typedef PixelHSV< Float64 > PixelHSVFloat64
typedef PixelRGB< UnsignedInt8 > PixelRGB8
typedef PixelRGB< UnsignedInt16 > PixelRGB16
typedef PixelRGB< Int16 > PixelRGBSigned16
typedef PixelRGB< Int32 > PixelRGBSigned32
typedef PixelRGB< Float32 > PixelRGBFloat32
typedef PixelRGB< Float64 > PixelRGBFloat64
typedef PixelRGBA< UnsignedInt8 > PixelRGBA8
typedef PixelRGBA< UnsignedInt16 > PixelRGBA16
typedef PixelRGBA< Int16 > PixelRGBASigned16
typedef PixelRGBA< Int32 > PixelRGBASigned32
typedef PixelRGBA< Float32 > PixelRGBAFloat32
typedef PixelRGBA< Float64 > PixelRGBAFloat64

Enumerations

enum  ImageFormat {
  GRAY1, GRAY8, GRAY16, GRAY32,
  GRAY64, GRAY_SIGNED16, GRAY_SIGNED32, GRAY_FLOAT32,
  GRAY_FLOAT64, RGB8, RGB16, RGB_SIGNED16,
  RGB_SIGNED32, RGB_FLOAT32, RGB_FLOAT64, HSV_FLOAT64,
  BGRA8, RGBA8, YUV420
}
 This enum indicates the acceptable image format values. More...
enum  SnakeStrategy { SNAKE_EUCLIDEAN_DISTANCE }

Functions

template<ImageFormat FORMAT>
Image< GRAY1 > applyCanny (const Image< FORMAT > &inputImage, size_t gaussianSize=5, double upperThreshold=0.0, double lowerThreshold=0.0)
template<ImageFormat FORMAT_OUT, ImageFormat FORMAT_IN>
Image< FORMAT_OUT > connectedComponents (const Image< FORMAT_IN > &inputImage)
template<ImageFormat FORMAT_OUT, ImageFormat FORMAT_IN>
Image< FORMAT_OUT > connectedComponents (const Image< FORMAT_IN > &inputImage, size_t &numberOfComponents)
 This function is just like connectedComponents(const Image&), except that it also returns (by reference) the number of components in the image.
template<ImageFormat FORMAT>
Image< FORMAT > dilate (const Image< FORMAT > &inputImage)
template<ImageFormat FORMAT>
Image< FORMAT > erode (const Image< FORMAT > &inputImage)
template<ImageFormat OutputFormat, ImageFormat IntermediateFormat, ImageFormat ImageFormat, class KernelType>
Image< OutputFormat > filter2D (const Kernel< KernelType > &kernel, const Image< ImageFormat > &image, const typename ImageFormatTraits< OutputFormat >::PixelType fillValue, ConvolutionStrategy convolutionStrategy=DLR_CONVOLVE_PAD_RESULT)
 This function filters an image with the given kernel.
template<ImageFormat OutputFormat, ImageFormat IntermediateFormat, ImageFormat ImageFormat, class KernelType>
void filter2D (Image< OutputFormat > &outputImage, const Kernel< KernelType > &kernel, const Image< ImageFormat > &image, const typename ImageFormatTraits< OutputFormat >::PixelType fillValue, ConvolutionStrategy convolutionStrategy=DLR_CONVOLVE_PAD_RESULT)
 This function filters an image with the given kernel, placing the result into a pre-constructed Image instance.
template<ImageFormat FORMAT>
Array2D< double > getEuclideanDistance (const Image< FORMAT > &inputImage, size_t maxNumberOfPasses)
template<ImageFormat FORMAT>
Array2D< double > getEuclideanDistance (const Image< FORMAT > &inputImage, size_t maxNumberOfPasses, size_t &numberOfPassesUsed)
Array1D< unsigned int > getHistogram (const Image< GRAY8 > &inputImage)
 This function computes the histogram of an image.
Image< GRAY8 > histogramEqualize (const Image< GRAY8 > &inputImage)
 This function remaps the pixel values of the input image in such a way that output pixel value increases monotonically with input pixel value, and the histogram of the output image is nearly flat.
Image< GRAY8 > readPGM8 (const std::string &fileName)
Image< GRAY8 > readPGM8 (const std::string &fileName, std::string &commentString)
Image< GRAY16 > readPGM16 (const std::string &fileName)
Image< RGB8 > readPPM8 (const std::string &fileName)
void writePGM8 (const std::string &fileName, const Image< GRAY8 > &outputImage, const std::string &comment)
void writePGM16 (const std::string &fileName, const Image< GRAY16 > &outputImage, const std::string &comment)
void writePPM8 (const std::string &fileName, const Image< RGB8 > &outputImage, const std::string &comment)
template<class KERNEL_TYPE>
Kernel< KERNEL_TYPE > getGaussianKernel (size_t rows, size_t columns, double rowSigma=-1.0, double columnSigma=-1.0)
template<ImageFormat FORMAT>
Image< FORMAT > nonMaximumSuppress (const Image< FORMAT > &inputImage, const Array2D< Float64 > &gradX, const Array2D< Float64 > &gradY)
 This function zeros any pixels of the input image which are not plausible edges.
template<class TYPE>
PixelBGRA< TYPE > operator- (const PixelBGRA< TYPE > &pixel0, const PixelBGRA< TYPE > &pixel1)
 This operator subtracts the values of the individual color components of its arguments.
template<class TYPE>
bool operator== (const PixelBGRA< TYPE > &pixel0, const PixelBGRA< TYPE > &pixel1)
 This operator returns true if the contents of the two argments are identical, false otherwise.
template<class TYPE>
PixelHSV< TYPE > operator- (const PixelHSV< TYPE > &pixel0, const PixelHSV< TYPE > &pixel1)
 This operator subtracts the values of the individual color components of its arguments.
template<class TYPE>
bool operator== (const PixelHSV< TYPE > &pixel0, const PixelHSV< TYPE > &pixel1)
 This operator returns true if the contents of the two argments are identical, false otherwise.
template<class TYPE>
PixelRGB< TYPE > operator- (const PixelRGB< TYPE > &pixel0, const PixelRGB< TYPE > &pixel1)
 This operator subtracts the values of the individual color components of its arguments.
template<class TYPE>
bool operator== (const PixelRGB< TYPE > &pixel0, const PixelRGB< TYPE > &pixel1)
 This operator returns true if the contents of the two argments are identical, false otherwise.
template<class TYPE>
PixelRGBA< TYPE > operator- (const PixelRGBA< TYPE > &pixel0, const PixelRGBA< TYPE > &pixel1)
 This operator subtracts the values of the individual color components of its arguments.
template<class TYPE>
bool operator== (const PixelRGBA< TYPE > &pixel0, const PixelRGBA< TYPE > &pixel1)
 This operator returns true if the contents of the two argments are identical, false otherwise.
template<class InIter0, class InIter1>
Transform3D registerPoints3D (InIter0 fromPointsBegin, InIter0 fromPointsEnd, InIter1 toPointsBegin)
template<class InIter0, class InIter1, class InIter2>
Transform3D registerPoints3D (InIter0 fromPointsBegin, InIter0 fromPointsEnd, InIter1 toPointsBegin, InIter2 selectedFlagsBegin)
 This function works just like the three-argument form of registerPoints3D(), except that only selected points are considered in the registration.
template<class InIter0, class InIter1, class OutIter0>
Transform3D registerPoints3D (InIter0 fromPointsBegin, InIter0 fromPointsEnd, InIter1 toPointsBegin, OutIter0 selectedFlagsBegin, double inclusion, double maximumResidual=-1.0, size_t maximumIterations=5)
 This function calls the four-argument form of registerPoints3D() repeatedly while trying to identify and ignore outliers.
template<ImageFormat FORMAT>
Image< FORMAT > applySobelX (const Image< FORMAT > &inputImage, bool normalizeResult=false)
 This function applies the sobel edge operator in the X direction.
template<ImageFormat FORMAT>
Image< FORMAT > applySobelY (const Image< FORMAT > &inputImage, bool normalizeResult=false)
 This function applies the sobel edge operator in the Y direction.
template<ImageFormat FORMAT>
bool associateColorComponents (Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &inputArray, Image< FORMAT > &outputImage)
template<ImageFormat FORMAT>
Image< FORMAT > associateColorComponents (Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &inputArray)
template<ImageFormat OUTPUT_FORMAT, ImageFormat INPUT_FORMAT>
Image< OUTPUT_FORMAT > convertColorspace (const Image< INPUT_FORMAT > &inputImage)
 This function takes an image in one colorspace and generates a corresponding image in a second colorspace.
template<ImageFormat FORMAT>
bool dissociateColorComponents (Image< FORMAT > &inputImage, Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &outputArray)
 This function returns by reference an array which either shares or copies the data from the input image.
template<ImageFormat FORMAT>
Array2D< typename ImageFormatTraits<
FORMAT >::ComponentType > 
dissociateColorComponents (Image< FORMAT > &inputImage)
template<ImageFormat Format>
Image< Format > subsample (const Image< Format > &inputImage, size_t rowStep=2, size_t columnStep=2)
 This function subsamples its input to create a new, smaller image.
template<class Type, ImageFormat FORMAT>
Array2D< Type > toArray (const Image< FORMAT > &inputImage)
 This function creates a new array and copies into it the pixel data from the input image.


Detailed Description

This namespace is still in the early stages of development.

Feel free to play around with it, but please bear in mind that its interface is not stable.


Enumeration Type Documentation

enum dlr::computerVision::ImageFormat

This enum indicates the acceptable image format values.

Please see the ImageFormatTraits class template for the characteristics of these image formats.

Enumerator:
GRAY1 
GRAY8 
GRAY16 
GRAY32 
GRAY64 
GRAY_SIGNED16 
GRAY_SIGNED32 
GRAY_FLOAT32 
GRAY_FLOAT64 
RGB8 
RGB16 
RGB_SIGNED16 
RGB_SIGNED32 
RGB_FLOAT32 
RGB_FLOAT64 
HSV_FLOAT64 
BGRA8 
RGBA8 
YUV420 

Definition at line 27 of file imageFormat.h.

enum dlr::computerVision::SnakeStrategy

Enumerator:
SNAKE_EUCLIDEAN_DISTANCE 

Definition at line 26 of file naiveSnake.h.


Function Documentation

template<ImageFormat FORMAT>
Image< FORMAT > dlr::computerVision::applySobelX ( const Image< FORMAT > &  inputImage,
bool  normalizeResult = false 
) [inline]

This function applies the sobel edge operator in the X direction.

Specifically, convolves the image with the 3x3 kernel

   [[-1, 0, 1],
    [-2, 0, 2],
    [-1, 0, 1]]

and then optionally rescales the result to be proportional to the image gradient with scale factor 1.0.

Parameters:
inputImage This argument is the image to be convolved.
normalizeResult This argument specifies whether or not to divide the resulting pixel values by 8. Setting this argument to true will result in lost precision on integer types. This feature is currently not implemented, so please leave normalizeResult at its default value of false.
Returns:
The return value is the result of the convolution.

Definition at line 96 of file sobel.h.

References DLR_THROW.

Referenced by applyCanny(), and dlr::computerVision::Snake::setInterestImage().

template<ImageFormat FORMAT>
Image< FORMAT > dlr::computerVision::applySobelY ( const Image< FORMAT > &  inputImage,
bool  normalizeResult = false 
) [inline]

This function applies the sobel edge operator in the Y direction.

Specifically, convolves the image with the 3x3 kernel

   [[-1, -2, -1],
    [ 0,  0,  0],
    [ 1,  2,  1]]

and then optionally rescales the result to be proportional to the image gradient with scale factor 1.0.

Parameters:
inputImage This argument is the image to be convolved.
normalizeResult This argument specifies whether or not to divide the resulting pixel values by 8. Setting this argument to true will result in lost precision on integer types. This feature is currently not implemented, so please leave normalizeResult at its default value of false.
Returns:
The return value is the result of the convolution.

Definition at line 192 of file sobel.h.

References DLR_THROW.

Referenced by applyCanny(), and dlr::computerVision::Snake::setInterestImage().

template<ImageFormat FORMAT>
Image< FORMAT > dlr::computerVision::associateColorComponents ( Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &  inputArray  )  [inline]

Deprecated:
{Please use the two-argument version of associateColorComponents() instead.}
This function tries to return an Image which references the same memory as the input array, but in which each pixel is the aggregate of the appropriate number of elements from the array. If it is not possible to do so, then this function will throw a LogicException. This function is deprecated. Instead, ues the two-argument form of associateColorComponents().

WARNING: The returned image does no memory management. It is only valid until the original input image is destroyed.

Parameters:
inputArray This argument is the array from which to construct the return image.
Returns:
The return value is an image pointing to the input array data, but in which the color components are lumped into pixels.

Definition at line 585 of file dlrComputerVision/utilities.h.

References associateColorComponents(), and DLR_THROW.

Referenced by associateColorComponents().

template<ImageFormat FORMAT>
bool dlr::computerVision::associateColorComponents ( Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &  inputArray,
Image< FORMAT > &  outputImage 
) [inline]

If possible, this function returns an Image which references the same memory as the input array, but in which each pixel is the aggregate of the appropriate number of elements from the array. For example, if this function is called with template argument RGB8, and an Nx(3*M) array of UnsignedInt8 is passed as the argument, then the return value will be an NxM Image<RGB8> which references the same memory as the argument. Imagine that the first three elements of the first row of the argument are 12, 14, and 72. In this case, the upper-left RGB value of the returned image image is {12, 14, 72}. This memory sharing only works if the compiler does not "pad" the pixel struct to byte align its members.

If memory sharing is not possible, then this function tests the size of argument outputImage, reinitializes it only if the size does not match the size of the input array, and then copies the data from inputArray to outputImage.

WARNING: If data sharing is possible, the returned image does no memory management. It is only valid until the original input data is destroyed.

If you use this function in conjunction with dissociateColorComponents(), you can simply ignore the question of whether the data sharing works or not. For example, you might use associateColorComponents to get an Image to operate on, do all of your image processing, and then use dissocateColorComponents to get back to a flat array. If data sharing is possible, all of your operations will have taken place in the original array. If data sharing isn't possible, then the two functions will take care of copying back and forth between the image and the flat array.

Parameters:
inputArray This argument is the array from which to construct the return image.
outputImage This argument is the image which will be modified or copied to.
Returns:
The return value is true if the returned image shares data with the input array, false otherwise.

Definition at line 571 of file dlrComputerVision/utilities.h.

References associateColorComponents().

Referenced by associateColorComponents().

template<ImageFormat FORMAT_OUT, ImageFormat FORMAT_IN>
Image< FORMAT_OUT > dlr::computerVision::connectedComponents ( const Image< FORMAT_IN > &  inputImage,
size_t &  numberOfComponents 
) [inline]

This function is just like connectedComponents(const Image&), except that it also returns (by reference) the number of components in the image.

Parameters:
inputImage This argument is the segmented image. Pixels which are not part of a blob must have value of 0. All other values are considered to be blob pixels. All non-zero pixels are considered to be part of the same class. That is, adjacent pixels with different non-zero values will be considered to be part of the same blob.
numberOfComponents This argument returns by reference how many distinct components were identified in the image, not counting the background.
Returns:
The return value is an image of labels in which each pixel describes the the corresponding pixel of the input image. Blobs in the input image will be labeled 0, 1, 2, etc. in the output image. Note that the assignment of labels to blobs is unspecified: it is _not_ true that the largest blob gets the lowest label.

Definition at line 156 of file connectedComponents.h.

template<ImageFormat FORMAT_OUT, ImageFormat FORMAT_IN>
Image< FORMAT_OUT > dlr::computerVision::connectedComponents ( const Image< FORMAT_IN > &  inputImage  )  [inline]

Parameters:
inputImage This argument is the segmented image. Pixels which are not part of a blob must have value of 0. All other values are considered to be blob pixels. All non-zero pixels are considered to be part of the same class. That is, adjacent pixels with different non-zero values will be considered to be part of the same blob.
Returns:
The return value is an image of labels in which each pixel describes the the corresponding pixel of the input image. Blobs in the input image will be labeled 0, 1, 2, etc. in the output image. Note that the assignment of labels to blobs is unspecified: it is _not_ true that the largest blob gets the lowest label.

Definition at line 145 of file connectedComponents.h.

template<ImageFormat OUTPUT_FORMAT, ImageFormat INPUT_FORMAT>
Image< OUTPUT_FORMAT > dlr::computerVision::convertColorspace ( const Image< INPUT_FORMAT > &  inputImage  )  [inline]

This function takes an image in one colorspace and generates a corresponding image in a second colorspace.

Use this function as follows:

Image<GRAY8> = convertColorspace<GRAY8, RGB16>(myRGB16Image);

or equivalently, the second template argument can be left implicit,

Image<GRAY8> = convertColorspace<GRAY8>(myRGB16Image);

This function only works for image formats in which there's a one-to-one mapping between input and output pixel types. When converting between formats which don't match this requirement, such as when converting from RGB8 to YUV420, please use a different routine.

Parameters:
inputImage This argument is the image to be converted.
Returns:
The return value is an image in the converted colorspace.

Definition at line 606 of file dlrComputerVision/utilities.h.

template<ImageFormat FORMAT>
Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > dlr::computerVision::dissociateColorComponents ( Image< FORMAT > &  inputImage  )  [inline]

Deprecated:
{Please use the two-argument version of dissociateColorComponents() instead.}
This function tries to return an Array2D which references the same memory as the input image, but in which each pixel has been "flattened" so that the returned array has a separate element for each color component of each pixel. If it is not possible to do so, then this function will throw a LogicException. This function is deprecated. Instead, ues the two-argument form of dissociateColorComponents().

WARNING: The returned array does no memory management. It is only valid until the original input image is destroyed.

Parameters:
inputImage This argument is the image from which to construct the return array.
Returns:
The return value is a 2D array pointing to the input image data, but in which the color components are not lumped into pixels.

Definition at line 635 of file dlrComputerVision/utilities.h.

References dissociateColorComponents(), and DLR_THROW.

Referenced by dissociateColorComponents().

template<ImageFormat FORMAT>
bool dlr::computerVision::dissociateColorComponents ( Image< FORMAT > &  inputImage,
Array2D< typename ImageFormatTraits< FORMAT >::ComponentType > &  outputArray 
) [inline]

This function returns by reference an array which either shares or copies the data from the input image.

If possible, this function returns an Array2D which references the same memory as the input image, but in which each pixel has been "flattened" so that the returned array has a separate element for each color component of each pixel. For example, if this function is called with an NxM Image<RGB8> as its argument, the returned value will be an Nx(3*M) array of 8-bit unsigned ints which references the same memorty. Imagine that the upper-left RGB value of the image is {12, 14, 72}. In this case, the first three elements of first row of the returned image will be 12, 14, and 72. This memory sharing only works if the compiler does not "pad" the pixel struct to byte align its members.

If memory sharing is not possible, then this function tests the size of argument outputArray, reinitializes it only if the size does not match the size of the input image, and then copies the data from inputImage to outputArray.

WARNING: If data sharing is possible, the returned array does no memory management. It is only valid until the original input data is destroyed.

If you use this function in conjunction with associateColorComponents(), you can simply ignore the question of whether the data sharing works or not. For example, you might use associateColorComponents to get an Image to operate on, do all of your image processing, and then use dissocateColorComponents to get back to a flat array. If data sharing is possible, all of your operations will have taken place in the original array. If data sharing isn't possible, then the two functions will take care of copying back and forth between the image and the flat array.

Parameters:
inputImage This argument is the image from which to construct the return array.
This argument is the array which will be modified or copied to.

Returns:
The return value is true if the returned array shares data with the input image, false otherwise.

Definition at line 621 of file dlrComputerVision/utilities.h.

References dissociateColorComponents().

Referenced by dissociateColorComponents(), and toArray().

template<ImageFormat OutputFormat, ImageFormat IntermediateFormat, ImageFormat ImageFormat, class KernelType>
void dlr::computerVision::filter2D ( Image< OutputFormat > &  outputImage,
const Kernel< KernelType > &  kernel,
const Image< ImageFormat > &  image,
const typename ImageFormatTraits< OutputFormat >::PixelType  fillValue,
ConvolutionStrategy  convolutionStrategy = DLR_CONVOLVE_PAD_RESULT 
) [inline]

This function filters an image with the given kernel, placing the result into a pre-constructed Image instance.

Argument "convolutionStrategy" indicates what to do with the edges of the filtered image (where the filter kernel only partially overlaps the input image). Currently filter() only supports DLR_CONVOLVE_PAD_RESULT.

Parameters:
outputImage This argument is used to return the result. The associated memory is not reallocated unless outputImage has a different number of rows and/or columns than image.
kernel This argument is the Kernel instance with which to filter.
image This argument is the Image to be filtered.
fillValue This argument specifies the value with which image edges should be padded.
convolutionStrategy This argument specifies how to handle the edges of the image. Please see the dlrNumeric documentation for more information.

Definition at line 498 of file filter.h.

References dlr::numeric::DLR_CONVOLVE_PAD_RESULT, dlr::numeric::DLR_CONVOLVE_ROI_SAME, dlr::computerVision::Kernel< ELEMENT_TYPE >::getArray2D(), dlr::computerVision::Kernel< ELEMENT_TYPE >::getColumnComponent(), dlr::computerVision::Kernel< ELEMENT_TYPE >::getRowComponent(), and dlr::computerVision::Kernel< ELEMENT_TYPE >::isSeparable().

template<ImageFormat OutputFormat, ImageFormat IntermediateFormat, ImageFormat ImageFormat, class KernelType>
Image< OutputFormat > dlr::computerVision::filter2D ( const Kernel< KernelType > &  kernel,
const Image< ImageFormat > &  image,
const typename ImageFormatTraits< OutputFormat >::PixelType  fillValue,
ConvolutionStrategy  convolutionStrategy = DLR_CONVOLVE_PAD_RESULT 
) [inline]

This function filters an image with the given kernel.

Argument "convolutionStrategy" indicates what to do with the edges of the filtered image (where the filter kernel only partially overlaps the input image). Currently filter() only supports DLR_CONVOLVE_PAD_RESULT.

Parameters:
kernel This argument is the Kernel instance with which to filter.
image This argument is the Image to be filtered.
fillValue This argument specifies the value with which image edges should be padded.
convolutionStrategy This argument specifies how to handle the edges of the image. Please see the dlrNumeric documentation for more information.
Returns:
The return value is a filtered copy of image.

Definition at line 477 of file filter.h.

template<class KERNEL_TYPE>
Kernel< KERNEL_TYPE > dlr::computerVision::getGaussianKernel ( size_t  rows,
size_t  columns,
double  rowSigma = -1.0,
double  columnSigma = -1.0 
) [inline]

The kernel will be normalized prior to return, so that the sum of its elements is equal to zero.

Parameters:
rows This argument specifies how many rows the kernel should have.
columns This argument specifies how many columns the kernel should have.
rowSigma This argument specifies the standard deviation of the kernel in the Y direction. If sigma is less than 0.0, then it will be automatically reset to rows / 6.0.
columnSigma This argument specifies the standard deviation of the kernel in the X direction. If sigma is less than 0.0, then it will be automatically reset columns / 6.0.
Returns:
The return value is the kernel itself.

Definition at line 95 of file kernels.h.

References DLR_THROW.

Array1D< unsigned int > dlr::computerVision::getHistogram ( const Image< GRAY8 > &  inputImage  ) 

This function computes the histogram of an image.

That is, it counts the number of pixels with each possible value and returns a 1D array of counts.

Parameters:
inputImage This argument is the image to be histogrammed.
Returns:
The return value is a 1D array in which the first element indicates the number of pixels having the value 0, the second element indicates the number of pixels having the value 1, and so forth.

Definition at line 26 of file histogramEqualize.cpp.

References DLR_THROW.

Referenced by histogramEqualize().

Image< GRAY8 > dlr::computerVision::histogramEqualize ( const Image< GRAY8 > &  inputImage  ) 

This function remaps the pixel values of the input image in such a way that output pixel value increases monotonically with input pixel value, and the histogram of the output image is nearly flat.

Parameters:
inputImage This argument is the image to be equalized.
Returns:
The return value is the histogram equalized image.

Definition at line 50 of file histogramEqualize.cpp.

References getHistogram().

template<ImageFormat FORMAT>
Image< FORMAT > dlr::computerVision::nonMaximumSuppress ( const Image< FORMAT > &  inputImage,
const Array2D< Float64 > &  gradX,
const Array2D< Float64 > &  gradY 
) [inline]

This function zeros any pixels of the input image which are not plausible edges.

Definition at line 53 of file nonMaximumSuppress.h.

References DLR_THROW.

Referenced by applyCanny().

template<class TYPE>
PixelRGBA< TYPE > dlr::computerVision::operator- ( const PixelRGBA< TYPE > &  pixel0,
const PixelRGBA< TYPE > &  pixel1 
) [inline]

This operator subtracts the values of the individual color components of its arguments.

Parameters:
pixel0 The color component values of pixel1 will be subtracted from the color component values of this pixel.
pixel1 The color component values of this pixel will be subtracted from the color component values of pixel1.
Returns:
The return value is a pixel in which each color component value is the difference of the corresponding values in the two input pixels.

Definition at line 226 of file pixelRGBA.h.

References dlr::computerVision::PixelRGBA< TYPE >::alpha, dlr::computerVision::PixelRGBA< TYPE >::blue, dlr::computerVision::PixelRGBA< TYPE >::green, and dlr::computerVision::PixelRGBA< TYPE >::red.

template<class TYPE>
PixelRGB< TYPE > dlr::computerVision::operator- ( const PixelRGB< TYPE > &  pixel0,
const PixelRGB< TYPE > &  pixel1 
) [inline]

This operator subtracts the values of the individual color components of its arguments.

Parameters:
pixel0 The color component values of pixel1 will be subtracted from the color component values of this pixel.
pixel1 The color component values of this pixel will be subtracted from the color component values of pixel1.
Returns:
The return value is a pixel in which each color component value is the difference of the corresponding values in the two input pixels.

Definition at line 217 of file pixelRGB.h.

References dlr::computerVision::PixelRGB< TYPE >::blue, dlr::computerVision::PixelRGB< TYPE >::green, and dlr::computerVision::PixelRGB< TYPE >::red.

template<class TYPE>
PixelHSV< TYPE > dlr::computerVision::operator- ( const PixelHSV< TYPE > &  pixel0,
const PixelHSV< TYPE > &  pixel1 
) [inline]

This operator subtracts the values of the individual color components of its arguments.

Parameters:
pixel0 The color component values of pixel1 will be subtracted from the color component values of this pixel.
pixel1 The color component values of this pixel will be subtracted from the color component values of pixel1.
Returns:
The return value is a pixel in which each color component value is the difference of the corresponding values in the two input pixels.

Definition at line 219 of file pixelHSV.h.

References dlr::computerVision::PixelHSV< TYPE >::hue, dlr::computerVision::PixelHSV< TYPE >::saturation, and dlr::computerVision::PixelHSV< TYPE >::value.

template<class TYPE>
PixelBGRA< TYPE > dlr::computerVision::operator- ( const PixelBGRA< TYPE > &  pixel0,
const PixelBGRA< TYPE > &  pixel1 
) [inline]

This operator subtracts the values of the individual color components of its arguments.

Parameters:
pixel0 The color component values of pixel1 will be subtracted from the color component values of this pixel.
pixel1 The color component values of this pixel will be subtracted from the color component values of pixel1.
Returns:
The return value is a pixel in which each color component value is the difference of the corresponding values in the two input pixels.

Definition at line 226 of file pixelBGRA.h.

References dlr::computerVision::PixelBGRA< TYPE >::alpha, dlr::computerVision::PixelBGRA< TYPE >::blue, dlr::computerVision::PixelBGRA< TYPE >::green, and dlr::computerVision::PixelBGRA< TYPE >::red.

template<class TYPE>
bool dlr::computerVision::operator== ( const PixelRGBA< TYPE > &  pixel0,
const PixelRGBA< TYPE > &  pixel1 
) [inline]

This operator returns true if the contents of the two argments are identical, false otherwise.

Parameters:
pixel0 This argument is the first pixel value to be compared.
pixel1 This argument is the second pixel value to be compared.
Returns:
The return value indicates whether the two pixels have identical values.

Definition at line 240 of file pixelRGBA.h.

References dlr::computerVision::PixelRGBA< TYPE >::alpha, dlr::computerVision::PixelRGBA< TYPE >::blue, dlr::computerVision::PixelRGBA< TYPE >::green, and dlr::computerVision::PixelRGBA< TYPE >::red.

template<class TYPE>
bool dlr::computerVision::operator== ( const PixelRGB< TYPE > &  pixel0,
const PixelRGB< TYPE > &  pixel1 
) [inline]

This operator returns true if the contents of the two argments are identical, false otherwise.

Parameters:
pixel0 This argument is the first pixel value to be compared.
pixel1 This argument is the second pixel value to be compared.
Returns:
The return value indicates whether the two pixels have identical values.

Definition at line 230 of file pixelRGB.h.

References dlr::computerVision::PixelRGB< TYPE >::blue, dlr::computerVision::PixelRGB< TYPE >::green, and dlr::computerVision::PixelRGB< TYPE >::red.

template<class TYPE>
bool dlr::computerVision::operator== ( const PixelHSV< TYPE > &  pixel0,
const PixelHSV< TYPE > &  pixel1 
) [inline]

This operator returns true if the contents of the two argments are identical, false otherwise.

Parameters:
pixel0 This argument is the first pixel value to be compahue.
pixel1 This argument is the second pixel value to be compahue.
Returns:
The return value indicates whether the two pixels have identical values.

Definition at line 232 of file pixelHSV.h.

References dlr::computerVision::PixelHSV< TYPE >::hue, dlr::computerVision::PixelHSV< TYPE >::saturation, and dlr::computerVision::PixelHSV< TYPE >::value.

template<class TYPE>
bool dlr::computerVision::operator== ( const PixelBGRA< TYPE > &  pixel0,
const PixelBGRA< TYPE > &  pixel1 
) [inline]

This operator returns true if the contents of the two argments are identical, false otherwise.

Parameters:
pixel0 This argument is the first pixel value to be compablue.
pixel1 This argument is the second pixel value to be compablue.
Returns:
The return value indicates whether the two pixels have identical values.

Definition at line 240 of file pixelBGRA.h.

References dlr::computerVision::PixelBGRA< TYPE >::alpha, dlr::computerVision::PixelBGRA< TYPE >::blue, dlr::computerVision::PixelBGRA< TYPE >::green, and dlr::computerVision::PixelBGRA< TYPE >::red.

template<class InIter0, class InIter1, class OutIter0>
Transform3D dlr::computerVision::registerPoints3D ( InIter0  fromPointsBegin,
InIter0  fromPointsEnd,
InIter1  toPointsBegin,
OutIter0  selectedFlagsBegin,
double  inclusion,
double  maximumResidual = -1.0,
size_t  maximumIterations = 5 
) [inline]

This function calls the four-argument form of registerPoints3D() repeatedly while trying to identify and ignore outliers.

Iteration terminates when a call to the four-argument form of registerPoints3D() does not change the selected outlier list. Calling this function with argument inclusion set to 1.0 and argument maximumResidual less than zero is just the same as calling the four-argument form of of registerPoints3D with flagsBegin pointing to a sequence of all true.

Parameters:
fromPointsBegin This iterator, along with fromPointsEnd, defines one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by this iterator pair and transform them so that they match the corresponding elements of the "to" range as closely as possible in the least-squares sense.
fromPointsEnd See the documentation for argument fromPointsBegin.
toPointsBegin This argument defines the beginning of one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by arguments fromPointsBegin and fromPointsEnd, and transform them so that they match as closely as possible (in the least squares sense) the corresponding elements of the range starting from toPointsBegin and extending (fromPointsEnd - fromPointsBegin) elements. possible in the least-squares sense.
flagsBegin This output iterator will be used to return a sequence of bools indicating which points were used in the registration. For points which were included in the registration, the corresponding bool will be true.
inclusion This argument specifies the proportion of the dataset which is expected to be inliers. Setting this value to 1.0 or greater indicates that all of the points should be included in the registration, unless their inclusion is countermanded by argument maximumResidual. Setting this value less than 0.0 has the same effect as settint it to 1.0. To clarify(?): at each call to the three-argument form of registerPoints3D(), only floor(inclusion * (int)(fromPointsEnd - fromPointsBegin)) pairs of points will be used, and the points used will be those with the smallest residual prior to the call to the three-argument form of registerPoints3D().
maximumResidual This argument specifies the largest expected residual between corresponding points after the registration. Pairs of points which differ by more than this amount will be assumed to be outliers and ignored during the next registration. Setting this argument less than zero indicates that all pairs of points should be included in the registration, unless some points are countermanded by argument inclusion.
maximumIterations This argument how many iterations are permissible. The loop (register -> compute outliers -> repeat) will terminate after this many iterations even if the set of points chosen as outliers is still changing.
Returns:
The return value is a Transform3D instance which takes the points in the "from" range and matches them to the points in the "to" range.

Definition at line 351 of file registerPoints3D.h.

References dlr::common::composeFunctor_1_2(), DLR_THROW, dlr::numeric::magnitudeSquared(), and registerPoints3D().

template<class InIter0, class InIter1, class InIter2>
Transform3D dlr::computerVision::registerPoints3D ( InIter0  fromPointsBegin,
InIter0  fromPointsEnd,
InIter1  toPointsBegin,
InIter2  selectedFlagsBegin 
) [inline]

This function works just like the three-argument form of registerPoints3D(), except that only selected points are considered in the registration.

Parameters:
fromPointsBegin This iterator, along with fromPointsEnd, defines one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by this iterator pair and transform them so that they match the corresponding elements of the "to" range as closely as possible in the least-squares sense.
fromPointsEnd See the documentation for argument fromPointsBegin.
toPointsBegin This argument defines the beginning of one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by arguments fromPointsBegin and fromPointsEnd, and transform them so that they match as closely as possible (in the least squares sense) the corresponding elements of the range starting from toPointsBegin and extending (fromPointsEnd - fromPointsBegin) elements.
flagsBegin This argument defines the beginning of a sequence of boolean values indicating which points should be included in the registration. That is, flagsBegin is an iterator which must dereference to a bool, and the sequence from flagsBegin to flagsBegin + (fromPointsEnd - fromPointsBegin) must be valid. Points will be included in the registration iff the corresponding bool is true.
Returns:
The return value is a Transform3D instance which takes the points in the "from" range and matches them to the points in the "to" range.

Definition at line 238 of file registerPoints3D.h.

References dlr::numeric::argmax(), dlr::numeric::count(), DLR_THROW, dlr::linearAlgebra::eigenvectorsSymmetric(), dlr::numeric::matrixMultiply(), and dlr::numeric::quaternionToTransform3D().

template<class InIter0, class InIter1>
Transform3D dlr::computerVision::registerPoints3D ( InIter0  fromPointsBegin,
InIter0  fromPointsEnd,
InIter1  toPointsBegin 
) [inline]

Opt. Soc. Am., Vol. 4(4), April, 1987. Find the Rigid body tranform which takes one set of points and most nearly registers them with a second set.

Parameters:
fromPointsBegin This iterator, along with fromPointsEnd, defines one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by this iterator pair and transform them so that they match the corresponding elements of the "to" range as closely as possible in the least-squares sense.
fromPointsEnd See the documentation for argument fromPointsBegin.
toPointsBegin This argument defines the beginning of one of the two sets of points to be registered. The returned Transform3D instance will take points in the range specified by arguments fromPointsBegin and fromPointsEnd, and transform them so that they match as closely as possible (in the least squares sense) the corresponding elements of the range starting from toPointsBegin and extending (fromPointsEnd - fromPointsBegin) elements. possible in the least-squares sense.
Returns:
The return value is a Transform3D instance which takes the points in the "from" range and matches them to the points in the "to" range.

Definition at line 227 of file registerPoints3D.h.

Referenced by registerPoints3D().

template<ImageFormat Format>
Image< Format > dlr::computerVision::subsample ( const Image< Format > &  inputImage,
size_t  rowStep = 2,
size_t  columnStep = 2 
) [inline]

This function subsamples its input to create a new, smaller image.

The number of rows in the resulting image is the largest integer, r, such that rowStep * r <= inputImage.rows(). The number of columns in the resulting image is the largest integer, c, such that columnStep * c <= inputImage.columns(). The pixel values in the resulting image are the values at the intersection of every rowStep-th row and columnStep-th column of inputImage, starting with the value at (row, column) = (0, 0), which is always copied directly in to pixel (0, 0) of the result image. In other words, element (0, 0) of the resulting image is equal to element (0, 0) of inputImage, element (0, 1) of the resulting image is equal to element (0, columnStep) of inputImage, element (0, 2) of the resulting image is equal to element (0, 2 * columnStep) of inputImage, element (2, 4) of the resulting image is equal to element (2 * rowStep, 4 * columnStep) in inputImage.

Parameters:
inputImage This argument is the image to be subsampled.
rowStep This argument controls which rows of inputImage contribute to the result.
columnStep This argument controls which columns of inputImage contribute to the result.
Returns:
The return value is the subsampled image.

Definition at line 654 of file dlrComputerVision/utilities.h.

template<class Type, ImageFormat FORMAT>
Array2D< Type > dlr::computerVision::toArray ( const Image< FORMAT > &  inputImage  )  [inline]

This function creates a new array and copies into it the pixel data from the input image.

If the image format is one which has multiple interleaved color components, such as RGB8, then the returned array will have individual elements for each component of each pixel. For example, if the first row of an HSV8 image is [{h0, s0, v0}, {h1, s1, v1}, {h2, s2, v2}, ... ], then the first row of the array returned by toArray will be [h0, s0, v0, h1, s1, v1, h2, s2, v2, ...].

Parameters:
inputImage This argument is the image to be copied.
Returns:
The return value is an array containing the copied data.

Definition at line 738 of file dlrComputerVision/utilities.h.

References dissociateColorComponents().


Generated on Mon Jul 9 20:34:20 2007 for dlrLibs Utility Libraries by  doxygen 1.5.2