Autonomous Space Robotics Lab

Speeded Up SURF

UTIAS ASRL

asrl::GpuIntegralImageProcessor Class Reference

A class that reserves memory on the GPU for creating integral images. More...

#include <GpuIntegralImageProcessor.hpp>

List of all members.

Public Member Functions

 GpuIntegralImageProcessor (int width, int height)
 ~GpuIntegralImageProcessor ()
void upload (cv::Mat &img)
void process (cv::Mat &img, GpuIntegralImage &outImage, cudaStream_t stream=0)
void process (GpuIntegralImage &outImage, cudaStream_t stream=0)
int width ()
int height ()

Private Attributes

boost::shared_ptr< unsigned char > char_data
 Initial storage on the gpu of the unsigned char data.
boost::shared_ptr< float > norm_data
 Storage of floats on the GPU, for the standard orientation of the image.
boost::shared_ptr< float > trans_data
 A third buffer on the GPU used for the transpose operation.
size_t char_pitch
 The pitch (spacing between rows of data) of rows of the char_data array, in elements.
size_t norm_pitch
 The pitch (spacing between rows of data) of rows of the norm_data array, in elements.
size_t trans_pitch
 The pitch (spacing between rows of data) of rows of the trans_data array, in elements.
CUDPPHandle rowPlan
 The CUDPP configuration handle for a parallel prefix sum operation on the norm_data.
CUDPPHandle colPlan
 The CUDPP configuration handle for a parallel prefix sum operation on the trans_data.
int m_width
 The width of the input image (pixels).
int m_height
 The height of the input image (pixels).

Detailed Description

A class that reserves memory on the GPU for creating integral images.

This class sets up the necessary functions and memory for GpuIntegralImage_kernel.cu to compute the integral image.

Definition at line 55 of file GpuIntegralImageProcessor.hpp.


Constructor & Destructor Documentation

asrl::GpuIntegralImageProcessor::GpuIntegralImageProcessor ( int  width,
int  height 
)

The constructor reserves memory for integral image processing given that the source image is width$\times$height

Parameters:
width The width of the expected input image
height The height of the expected input image

Definition at line 44 of file GpuIntegralImageProcessor.cpp.

asrl::GpuIntegralImageProcessor::~GpuIntegralImageProcessor (  ) 

Destructor

Definition at line 74 of file GpuIntegralImageProcessor.cpp.


Member Function Documentation

int asrl::GpuIntegralImageProcessor::height (  )  [inline]
Returns:
The expected height of the input image (pixels)

Definition at line 112 of file GpuIntegralImageProcessor.hpp.

void asrl::GpuIntegralImageProcessor::process ( GpuIntegralImage outImage,
cudaStream_t  stream = 0 
)

Creates the integral image. The image must have been previously uploaded to the device by calling

 upload(img)
Parameters:
outImage 
stream 

Definition at line 109 of file GpuIntegralImageProcessor.cpp.

void asrl::GpuIntegralImageProcessor::process ( cv::Mat &  img,
GpuIntegralImage outImage,
cudaStream_t  stream = 0 
)

Uploads the image to the device then creates the integral image. This is the equivalent of calling

 upload(img);
 process(outImage,stream);
Parameters:
img The input image. The image must be tightly packed, of type CV_U8C1, and width()$\times$height()
outImage The output integral image
stream An optional cuda stream for performing the processing

Definition at line 104 of file GpuIntegralImageProcessor.cpp.

void asrl::GpuIntegralImageProcessor::upload ( cv::Mat &  img  ) 

Uploads the image to the device.

Parameters:
img The input image. The image must be tightly packed, of type CV_U8C1, and width()$\times$height()

Definition at line 93 of file GpuIntegralImageProcessor.cpp.

int asrl::GpuIntegralImageProcessor::width (  )  [inline]
Returns:
The expected width of the input image (pixels)

Definition at line 107 of file GpuIntegralImageProcessor.hpp.


Member Data Documentation

boost::shared_ptr<unsigned char> asrl::GpuIntegralImageProcessor::char_data [private]

Initial storage on the gpu of the unsigned char data.

Definition at line 115 of file GpuIntegralImageProcessor.hpp.

The pitch (spacing between rows of data) of rows of the char_data array, in elements.

Definition at line 123 of file GpuIntegralImageProcessor.hpp.

The CUDPP configuration handle for a parallel prefix sum operation on the trans_data.

Definition at line 132 of file GpuIntegralImageProcessor.hpp.

The height of the input image (pixels).

Definition at line 137 of file GpuIntegralImageProcessor.hpp.

The width of the input image (pixels).

Definition at line 135 of file GpuIntegralImageProcessor.hpp.

boost::shared_ptr<float> asrl::GpuIntegralImageProcessor::norm_data [private]

Storage of floats on the GPU, for the standard orientation of the image.

Definition at line 118 of file GpuIntegralImageProcessor.hpp.

The pitch (spacing between rows of data) of rows of the norm_data array, in elements.

Definition at line 125 of file GpuIntegralImageProcessor.hpp.

The CUDPP configuration handle for a parallel prefix sum operation on the norm_data.

Definition at line 130 of file GpuIntegralImageProcessor.hpp.

boost::shared_ptr<float> asrl::GpuIntegralImageProcessor::trans_data [private]

A third buffer on the GPU used for the transpose operation.

Definition at line 120 of file GpuIntegralImageProcessor.hpp.

The pitch (spacing between rows of data) of rows of the trans_data array, in elements.

Definition at line 127 of file GpuIntegralImageProcessor.hpp.


The documentation for this class was generated from the following files:

Generated on Fri Apr 30 20:06:20 2010 for gpusurf by doxygen 1.6.2