Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CutPaste.H File Reference


Detailed Description

Cut+paste operations from/to Image subregions

Definition in file CutPaste.H.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T_or_RGB>
Image< T_or_RGB > concatX (const Image< T_or_RGB > &left, const Image< T_or_RGB > &right)
 Horizontally concatenate two arrays of same height.
template<class T_or_RGB>
Image< T_or_RGB > concatY (const Image< T_or_RGB > &top, const Image< T_or_RGB > &bottom)
 Vertically concatenate two arrays of same width.
template<class T_or_RGB>
Image< T_or_RGB > concatLooseY (const Image< T_or_RGB > &topImg, const Image< T_or_RGB > &bottomImg, const T_or_RGB &bgColor=T_or_RGB())
 Vertically concatenate topImg and bottomImg.
template<class T_or_RGB>
Image< T_or_RGB > concatLooseX (const Image< T_or_RGB > &leftImg, const Image< T_or_RGB > &rightImg, const T_or_RGB &bgColor=T_or_RGB())
 Horizontally concatenate leftImg and rightImg.
template<class T_or_RGB>
Image< T_or_RGB > crop (const Image< T_or_RGB > &src, const Point2D< int > &upperLeft, const Dims &size, const bool zerofill=false)
 Extract a subimage from the input image.
template<class T_or_RGB>
Image< T_or_RGB > crop (const Image< T_or_RGB > &src, const Rectangle &rect, const bool zerofill=false)
 Overload of crop() using a Rectangle instead of a Point2D<int>+Dims.
template<class T_or_RGB>
Image< T_or_RGB > shift (const Image< T_or_RGB > &srcImg, const int dx, const int dy)
 Shift an image by (int dx, int dy), with horizontal wraparound.
template<class T_or_RGB>
Image< T_or_RGB > shiftImage (const Image< T_or_RGB > &srcImg, const float dx, const float dy)
 Shift an image by (float dx, float dy).
template<class T_or_RGB>
Image< T_or_RGB > shiftClean (const Image< T_or_RGB > &srcImg, const int dx, const int dy, const T_or_RGB bgval=T_or_RGB())
 Shift an image by (int dx, int dy), without wraparound.
template<class T_or_RGB>
void inplacePaste (Image< T_or_RGB > &dst, const Image< T_or_RGB > &img, const Point2D< int > &pos)
 Paste image into dst at given position.
template<class T_or_RGB>
void inplaceClearRegion (Image< T_or_RGB > &dst, const Rectangle &region, const T_or_RGB &val)
 Set all pixels within a given region to the specified value.
template<class T_or_RGB>
void inplaceEmbed (Image< T_or_RGB > &embed, const Image< T_or_RGB > &img, const Rectangle &r, const T_or_RGB background, const bool keep_aspect=true)
 Embed image into dst with position & size given in rectangle.
template<class T>
Rectangle findBoundingRect (const Image< T > &src, const T threshold)
 Find the smallest bounding rectangle around pixels greater than the threshold.


Function Documentation

template<class T_or_RGB>
Image<T_or_RGB> concatLooseX const Image< T_or_RGB > &  leftImg,
const Image< T_or_RGB > &  rightImg,
const T_or_RGB &  bgColor = T_or_RGB()
 

Horizontally concatenate leftImg and rightImg.

Like concatX(), but doesn't require the two images to have the same height.

template<class T_or_RGB>
Image<T_or_RGB> concatLooseY const Image< T_or_RGB > &  topImg,
const Image< T_or_RGB > &  bottomImg,
const T_or_RGB &  bgColor = T_or_RGB()
 

Vertically concatenate topImg and bottomImg.

Like concatY(), but doesn't require the two images to have the same width.

template<class T_or_RGB>
Image<T_or_RGB> concatX const Image< T_or_RGB > &  left,
const Image< T_or_RGB > &  right
 

Horizontally concatenate two arrays of same height.

template<class T_or_RGB>
Image<T_or_RGB> concatY const Image< T_or_RGB > &  top,
const Image< T_or_RGB > &  bottom
 

Vertically concatenate two arrays of same width.

template<class T_or_RGB>
Image<T_or_RGB> crop const Image< T_or_RGB > &  src,
const Rectangle rect,
const bool  zerofill = false
 

Overload of crop() using a Rectangle instead of a Point2D<int>+Dims.

template<class T_or_RGB>
Image<T_or_RGB> crop const Image< T_or_RGB > &  src,
const Point2D< int > &  upperLeft,
const Dims size,
const bool  zerofill = false
 

Extract a subimage from the input image.

The upper left corner of the subimage is given by a Point2D<int>, and the size of the subimage is given by the Dims. If zerofill is false, then the rectangle given by Point2D<int>+Dims must be wholly contained within the bounds of the input image. If zerofill is true, then any output region that lies outside the bounds of the input will be zero-filled (where zero means the default value for type T).

template<class T>
Rectangle findBoundingRect const Image< T > &  src,
const T  threshold
 

Find the smallest bounding rectangle around pixels greater than the threshold.

Definition at line 527 of file CutPaste.C.

References ASSERT, Image< T >::getHeight(), Image< T >::getVal(), Image< T >::getWidth(), GVX_TRACE, h, i, Image< T >::initialized(), LDEBUG, Rectangle::tlbrI(), and w.

Referenced by getCroppedObject(), and processSalCue().

template<class T_or_RGB>
void inplaceClearRegion Image< T_or_RGB > &  dst,
const Rectangle region,
const T_or_RGB &  val
 

Set all pixels within a given region to the specified value.

Does nothing if the rectangle is invalid.

template<class T_or_RGB>
void inplaceEmbed Image< T_or_RGB > &  embed,
const Image< T_or_RGB > &  img,
const Rectangle r,
const T_or_RGB  background,
const bool  keep_aspect = true
 

Embed image into dst with position & size given in rectangle.

template<class T_or_RGB>
void inplacePaste Image< T_or_RGB > &  dst,
const Image< T_or_RGB > &  img,
const Point2D< int > &  pos
 

Paste image into dst at given position.

Image must fit within dst and no resizing/interpolation is done. See embed() for a more sophisticated version with interpolation and resizing.

template<class T_or_RGB>
Image<T_or_RGB> shift const Image< T_or_RGB > &  srcImg,
const int  dx,
const int  dy
 

Shift an image by (int dx, int dy), with horizontal wraparound.

template<class T_or_RGB>
Image<T_or_RGB> shiftClean const Image< T_or_RGB > &  srcImg,
const int  dx,
const int  dy,
const T_or_RGB  bgval = T_or_RGB()
 

Shift an image by (int dx, int dy), without wraparound.

template<class T_or_RGB>
Image<T_or_RGB> shiftImage const Image< T_or_RGB > &  srcImg,
const float  dx,
const float  dy
 

Shift an image by (float dx, float dy).


Generated on Sun Nov 22 13:44:05 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4