curfil  ..
 All Classes Functions Variables Typedefs Friends Groups Pages
Public Member Functions | List of all members
curfil::RGBDImage Class Reference

An RGB-D image that contains four channels for the RGB color and the depth. More...

#include <image.h>

Public Member Functions

 RGBDImage (const std::string &filename, const std::string &depthFilename, bool useDepthImages, bool convertToCIELab=true, bool useDepthFilling=false, bool calculateIntegralImage=true)
 Load the RGB color image and the according depth from two files on disk.
 RGBDImage (int width, int height)
 For the test case.
 RGBDImage (const RGBDImage &other)
 uses the attributes of another object to set its attributes
size_t getSizeInMemory () const
void fillDepth ()
 Simple depth filling.
void reset ()
 resets all values to zero
const cuv::ndarray< float,
cuv::host_memory_space > & 
getColorImage () const
const cuv::ndarray< int,
cuv::host_memory_space > & 
getDepthImage () const
void calculateDerivative ()
 Calculate the image derivative.
void calculateIntegral ()
 Calculate the image integral.
void dump (std::ostream &out) const
 Print the image color channels in a human-readable format to the output stream.
void dumpDepth (std::ostream &out) const
 Print the image depth channel in a human-readable format to the output stream.
void dumpDepthValid (std::ostream &out) const
 Print the image depth valid channel in a human-readable format to the output stream.
void saveColor (const std::string &filename) const
 save (export) the image color channels to a file
void saveDepth (const std::string &filename) const
 save (export) the image depth channels to a file
const std::string & getFilename () const
int getWidth () const
int getHeight () const
bool hasIntegratedDepth () const
bool hasIntegratedColor () const
bool inImage (int x, int y) const
void setDepth (int x, int y, const Depth &depth)
 Sets a new depth at the given position.
Depth getDepth (int x, int y) const
int getDepthValid (int x, int y) const
void setColor (int x, int y, unsigned int channel, float color)
 sets a new color value at the given position and color channel
float getColor (int x, int y, unsigned int channel) const
void resizeImage (int newWidth, int newHeight)
 resize an image to a new depth and height

Detailed Description

An RGB-D image that contains four channels for the RGB color and the depth.

The class provides convenience methods to convert the image between RGB and CIELab color space and to calculate image integrals.

Image loading and saving is implemented using the vigraimpex library.

The image is stored as compact matrix in row-major order using cuv::ndarray.

Definition at line 174 of file image.h.

Constructor & Destructor Documentation

curfil::RGBDImage::RGBDImage ( const std::string &  filename,
const std::string &  depthFilename,
bool  useDepthImages,
bool  convertToCIELab = true,
bool  useDepthFilling = false,
bool  calculateIntegralImage = true 
)
explicit

Load the RGB color image and the according depth from two files on disk.

See the README file for the required file format.

Member Function Documentation

void curfil::RGBDImage::calculateDerivative ( )

Calculate the image derivative.

This method is only allowed if the image is already integrated.

void curfil::RGBDImage::calculateIntegral ( )

Calculate the image integral.

This method is only allowed if the image is not already integrated.

void curfil::RGBDImage::dump ( std::ostream &  out) const

Print the image color channels in a human-readable format to the output stream.

Used for debugging purposes and the test case.

void curfil::RGBDImage::dumpDepth ( std::ostream &  out) const

Print the image depth channel in a human-readable format to the output stream.

Used for debugging purposes and the test case.

void curfil::RGBDImage::dumpDepthValid ( std::ostream &  out) const

Print the image depth valid channel in a human-readable format to the output stream.

Used for debugging purposes and the test case.

void curfil::RGBDImage::fillDepth ( )

Simple depth filling.

Depth values are replaced by right,left,top,bottom neighbors (in that order)

float curfil::RGBDImage::getColor ( int  x,
int  y,
unsigned int  channel 
) const
inline
Parameters
xthe x position in the image where 0 <= x < width
ythe y position in the image where 0 <= y < height
channelthe color channel where 0 <= channel < COLOR_CHANNELS
Returns
the color value at the given position and color channel

Definition at line 377 of file image.h.

const cuv::ndarray<float, cuv::host_memory_space>& curfil::RGBDImage::getColorImage ( ) const
inline
Returns
a constant reference on the underlying RGB color matrix

Definition at line 229 of file image.h.

Depth curfil::RGBDImage::getDepth ( int  x,
int  y 
) const
inline
Returns
the depth value at the given position. Note: Can be an integrated value!

Definition at line 347 of file image.h.

const cuv::ndarray<int, cuv::host_memory_space>& curfil::RGBDImage::getDepthImage ( ) const
inline
Returns
a constant reference on the underlying depth matrix

Definition at line 236 of file image.h.

int curfil::RGBDImage::getDepthValid ( int  x,
int  y 
) const
inline
Returns
the depth validity information. 0 or 1 if the image is not integrated.

Definition at line 354 of file image.h.

const std::string& curfil::RGBDImage::getFilename ( ) const
inline
Returns
the name of the file this image was loaded from

Definition at line 288 of file image.h.

int curfil::RGBDImage::getHeight ( ) const
inline
Returns
height of the image in pixels

Definition at line 302 of file image.h.

size_t curfil::RGBDImage::getSizeInMemory ( ) const
inline
Returns
total size in memory in bytes

Definition at line 210 of file image.h.

int curfil::RGBDImage::getWidth ( ) const
inline
Returns
width of the image in pixels

Definition at line 295 of file image.h.

bool curfil::RGBDImage::hasIntegratedColor ( ) const
inline
Returns
true if and only if the image color channel was integrated

Definition at line 316 of file image.h.

bool curfil::RGBDImage::hasIntegratedDepth ( ) const
inline
Returns
true if and only if the image depth channel was integrated

Definition at line 309 of file image.h.

bool curfil::RGBDImage::inImage ( int  x,
int  y 
) const
inline
Returns
true if and only if the specified position lies in the image

Definition at line 323 of file image.h.

void curfil::RGBDImage::setColor ( int  x,
int  y,
unsigned int  channel,
float  color 
)
inline

sets a new color value at the given position and color channel

Parameters
xthe x position in the image where 0 <= x < width
ythe y position in the image where 0 <= y < height
channelthe color channel where 0 <= channel < COLOR_CHANNELS
colorthe new color value

Definition at line 366 of file image.h.

void curfil::RGBDImage::setDepth ( int  x,
int  y,
const Depth depth 
)
inline

Sets a new depth at the given position.

Be careful when the image is already integrated!

Definition at line 336 of file image.h.


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