CutPaste.H File Reference

#include <vector>
Include dependency graph for CutPaste.H:

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.
Rectangle findBoundingRect (const std::vector< Point2D< int > > &poly, const Dims imgDims)
 Find the smallest bounding rectangle around the polygon.

Detailed Description

Cut+paste operations from/to Image subregions

Definition in file CutPaste.H.


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() 
) [inline]

Horizontally concatenate leftImg and rightImg.

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

Referenced by ColorSegmenterI::updateFrame().

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() 
) [inline]

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 
) [inline]
template<class T_or_RGB >
Image<T_or_RGB> concatY ( const Image< T_or_RGB > &  top,
const Image< T_or_RGB > &  bottom 
) [inline]
template<class T_or_RGB >
Image<T_or_RGB> crop ( const Image< T_or_RGB > &  src,
const Rectangle rect,
const bool  zerofill = false 
) [inline]

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 
) [inline]

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).

Rectangle findBoundingRect ( const std::vector< Point2D< int > > &  poly,
const Dims  imgDims 
)

Find the smallest bounding rectangle around the polygon.

Definition at line 565 of file CutPaste.C.

References Dims::h(), height, Point2D< T >::i, and Dims::w().

template<class T >
Rectangle findBoundingRect ( const Image< T > &  src,
const T  threshold 
) [inline]

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(), Image< T >::initialized(), and Rectangle::tlbrI().

Referenced by InferoTemporalSIFT::attentionShift(), and XMLInput::readFrame().

template<class T_or_RGB >
void inplaceClearRegion ( Image< T_or_RGB > &  dst,
const Rectangle region,
const T_or_RGB &  val 
) [inline]

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 
) [inline]

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

Referenced by SimulationViewerNerdCam::drawMegaCombo(), SDLdisplay::makeBlittableSurface(), InputMbariFrameSeries::readRGB(), and submain().

template<class T_or_RGB >
void inplacePaste ( Image< T_or_RGB > &  dst,
const Image< T_or_RGB > &  img,
const Point2D< int > &  pos 
) [inline]
template<class T_or_RGB >
Image<T_or_RGB> shift ( const Image< T_or_RGB > &  srcImg,
const int  dx,
const int  dy 
) [inline]

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() 
) [inline]
template<class T_or_RGB >
Image<T_or_RGB> shiftImage ( const Image< T_or_RGB > &  srcImg,
const float  dx,
const float  dy 
) [inline]

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

Referenced by ReichardtPyrBuilder< T >::build(), and DisparityChannel::doInput().

Generated on Sun May 8 08:12:38 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3