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

ImageSetOps.C File Reference


Detailed Description

Free functions operating on sets of images

Definition in file ImageSetOps.C.

#include "Image/ImageSetOps.H"
#include "Image/DrawOps.H"
#include "Image/FilterOps.H"
#include "Image/Image.H"
#include "Image/ImageSet.H"
#include "Image/MathOps.H"
#include "Image/Range.H"
#include "Image/ShapeOps.H"
#include "Util/Assert.H"
#include "rutz/compat_cmath.h"
#include "inst/Image/ImageSetOps.I"

Include dependency graph for ImageSetOps.C:

Go to the source code of this file.

Functions

template<class T>
bool isHomogeneous (const ImageSet< T > &x)
template<class T>
bool isDyadic (const ImageSet< T > &pyr)
template<class T>
Image< T > sum (const ImageSet< T > &x)
 Returns the sum of all the images in the set. Requires isHomogeneous().
template<class T>
Image< T > mean (const ImageSet< T > &x)
 Returns the sum of all the images in the set. Requires isHomogeneous().
template<class T>
Range< T > rangeOf (const ImageSet< T > &x)
 Returns the overall range of all images in the set.
template<class T>
ImageSet< T > takeSlice (const ImageSet< T > *sets, uint nsets, uint level)
 Make an ImageSet from the s'th level from each of the N input sets.
template<class T>
Image< T > makeImageArray (const ImageSet< T > &x, int Nx, int grid_width, T grid_color, int destX, int destY)
 Make a single image-array from the set (see concatArray() in Image_ShapeOps).
template<class T>
ImageSet< T > reduce (const ImageSet< T > &x, int octaves)
 Make a new ImageSet by downscaling the input by the given number of octaves.
template<class T>
ImageSet< T > rescale (const ImageSet< T > &x, const Dims &dims)
 Make a new ImageSet by rescaling each input image to the given dimensions.
ImageSet< float > orientedFilterSet (const Image< float > &lowPassedInput, float period, const float *angles, const uint numAngles)
template<class T>
ImageSet< T > & operator-= (ImageSet< T > &x, const Image< T > &y)
 x -= y, for each image in x; requires isHomogeneous(x).
template<class T>
ImageSet< T > & operator+= (ImageSet< T > &x, const Image< T > &y)
 x += y, for each image in x; requires isHomogeneous(x).
template<class T>
ImageSet< T > & operator *= (ImageSet< T > &x, const Image< T > &y)
 x *= y, for each image in x; requires isHomogeneous(x).
template<class T>
ImageSet< T > & operator/= (ImageSet< T > &x, const Image< T > &y)
 x /= y, for each image in x; requires isHomogeneous(x).
template<class T>
ImageSet< T > & operator-= (ImageSet< T > &x, const T &v)
 x -= v, for each image in x
template<class T>
ImageSet< T > & operator+= (ImageSet< T > &x, const T &v)
 x += v, for each image in x
template<class T>
ImageSet< T > & operator *= (ImageSet< T > &x, const T &v)
 x *= v, for each image in x
template<class T>
ImageSet< T > & operator/= (ImageSet< T > &x, const T &v)
 x /= v, for each image in x
template<class T>
ImageSet< T > operator- (ImageSet< T > &x, const T &v)
 x - v, for each image in x
template<class T>
ImageSet< T > operator+ (ImageSet< T > &x, const T &v)
 x + v, for each image in x
template<class T>
ImageSet< T > operator * (ImageSet< T > &x, const T &v)
 x * v, for each image in x
template<class T>
ImageSet< T > operator/ (ImageSet< T > &x, const T &v)
 x / v, for each image in x
template<class T>
ImageSet< T > & operator-= (ImageSet< T > &x, const ImageSet< T > &y)
 x -= y, for each image in x with the respective image in y
template<class T>
ImageSet< T > & operator+= (ImageSet< T > &x, const ImageSet< T > &y)
 x += y, for each image in x with the respective image in y
template<class T>
ImageSet< T > & operator *= (ImageSet< T > &x, const ImageSet< T > &y)
 x *= y, for each image in x with the respective image in y
template<class T>
ImageSet< T > & operator/= (ImageSet< T > &x, const ImageSet< T > &y)
 x /= y, for each image in x with the respective image in y
template<class T>
ImageSet< T > clampedDiff (const ImageSet< T > &b, const ImageSet< T > &c)
 clampedDiff(b,c) for each image
template<class T>
void doRectify (ImageSet< T > &x)
 x = rectify(x), for each image in x
template<class T>
void doLowThresh (ImageSet< T > &x, const T threshold, const T newval)
 For each image in x, replace values < threshold with newval.
template<class T>
void doLowThreshAbs (ImageSet< T > &x, const T threshold, const T newval)
 For each image in x, replace values whose abs is < threshold with newval.
template<class T>
void doSqrt (ImageSet< T > &x)
 For each image in x, take the square root at every pixel.
void doMeanNormalize (ImageSet< float > &x)
void doOneNormalize (ImageSet< float > &x)
void doEnergyNorm (ImageSet< float > &x)
void doApplyBiases (ImageSet< float > &x, const float *biases)
void doAddWeighted (ImageSet< float > &x, const ImageSet< float > &y, float multiple)
void doClear (ImageSet< float > &x, float v)
template bool isDyadic (const ImageSet< int > &pyr)


Function Documentation

template<class T>
ImageSet<T> clampedDiff const ImageSet< T > &  b,
const ImageSet< T > &  c
 

clampedDiff(b,c) for each image

Definition at line 416 of file ImageSetOps.C.

Referenced by clampedDiff(), ImageCacheAvg< T >::clampedDiffMean(), OrientationChannel::doInteractions(), and main().

template<class T>
void doLowThresh ImageSet< T > &  x,
const T  threshold,
const T  newval
[inline]
 

For each image in x, replace values < threshold with newval.

Definition at line 443 of file ImageSetOps.C.

References i, inplaceLowThresh(), and ImageSet< T >::size().

Referenced by SingleChannel::computePyramid(), OrientationChannel::doInteractions(), and SingleChannel::setClipPyramid().

template<class T>
void doLowThreshAbs ImageSet< T > &  x,
const T  threshold,
const T  newval
[inline]
 

For each image in x, replace values whose abs is < threshold with newval.

Definition at line 451 of file ImageSetOps.C.

References i, inplaceLowThreshAbs(), and ImageSet< T >::size().

Referenced by SingleChannel::computePyramid().

template<class T>
void doRectify ImageSet< T > &  x  )  [inline]
 

x = rectify(x), for each image in x

Definition at line 435 of file ImageSetOps.C.

References i, inplaceRectify(), and ImageSet< T >::size().

Referenced by SingleChannel::computePyramid(), and ContourChannel::doInput().

template<class T>
void doSqrt ImageSet< T > &  x  )  [inline]
 

For each image in x, take the square root at every pixel.

Definition at line 459 of file ImageSetOps.C.

References i, ImageSet< T >::size(), and sqrt().

Referenced by DirectionChannel::computePyramid().

template<class T>
Image<T> makeImageArray const ImageSet< T > &  x,
int  Nx = -1,
int  grid_width = 1,
grid_color = T(),
int  destX = -1,
int  destY = -1
 

Make a single image-array from the set (see concatArray() in Image_ShapeOps).

Parameters:
Nx Number of columns; if negative, the result will be roughly square.
grid_width Pixel width of grid separators to be overlaid on image.
grid_color Color in which to draw grid.
destX Width to which each image is reshaped; if negative, reshape to size of first image.
destY Height to which each image is reshaped; if negative, reshape to size of first image.

Definition at line 148 of file ImageSetOps.C.

References concatArray(), drawGrid(), i, isDyadic(), ImageSet< T >::size(), sqrt(), y, and zoomXY().

Referenced by ContourChannel::doInput(), and main().

template<class T>
Image<T> mean const ImageSet< T > &  x  ) 
 

Returns the sum of all the images in the set. Requires isHomogeneous().

Definition at line 111 of file ImageSetOps.C.

Referenced by addNoise(), compProbHist(), cvRunHaarClassifierCascade(), dogFilterHmax(), VarianceChannel::doInput(), MultiColorBandChannel::doInput(), OrientationChannel::doInteractions(), doMeanNormalize(), covEstimate< T >::dumpMatrix(), energyNorm(), Beobot2GistSalMasterI::evolve(), V1::evolveGabor(), ObjRecBOF::extractGaborFeatures(), fillEyeData(), fillMouthData(), fillNoseData(), gaborFilter3(), SingleOpponentChannel::getFeaturesBatch(), SingleChannel::getFeaturesBatch(), ComplexChannel::getFeaturesBatch(), getGeomRelProb(), getNSS(), KLScorer::getScoreString(), getSubSum2(), greyWorldNormalize(), grid_averages(), Image_xx_clear_xx_1(), Image_xx_div_array_xx_1(), Image_xx_div_eq_array_xx_1(), Image_xx_div_eq_scalar_xx_1(), Image_xx_div_scalar_xx_1(), Image_xx_getMean_xx_1(), Image_xx_mean_xx_1(), Image_xx_minus_array_xx_1(), Image_xx_minus_eq_array_xx_1(), Image_xx_minus_eq_scalar_xx_1(), Image_xx_minus_scalar_xx_1(), Image_xx_mul_array_xx_1(), Image_xx_mul_eq_array_xx_1(), Image_xx_mul_eq_scalar_xx_1(), Image_xx_mul_scalar_xx_1(), Image_xx_plus_array_xx_1(), Image_xx_plus_eq_array_xx_1(), Image_xx_plus_eq_scalar_xx_1(), Image_xx_plus_scalar_xx_1(), Image_xx_sepFilter_xx_1(), Image_xx_sepFilter_xx_3(), Image_xx_sepFilter_xx_4(), Image_xx_sepFilter_xx_5(), Bayes::import(), HmaxFL::initFilters(), Hmax::initFilters(), inspect(), learningCoeff(), main(), maxNormalizeStdev0(), normalize(), ObjRecSPM::ObjRecSPM(), Pixels_xx_math_functions_xx_51(), Hmax::printCorners(), CudaHmax::printCorners(), StatsOutputSeries::Impl::printStatsRGB(), GSnav_M_Result::read(), Localization::resample(), Ganglion::setBias(), BayesNetworkDialog::setupTab(), showProb(), ScaleRemoveSurprise< FLOAT >::SRSsetAntiWeights(), ObjRec::start2(), stdev(), Context::testFrame(), train(), and Beobot2_GistSalLocalizerMasterI::updateMessage().

template<class T>
ImageSet<T> operator * ImageSet< T > &  x,
const T &  v
 

x * v, for each image in x

Definition at line 352 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator *= ImageSet< T > &  x,
const ImageSet< T > &  y
 

x *= y, for each image in x with the respective image in y

Definition at line 392 of file ImageSetOps.C.

References ASSERT, i, and ImageSet< T >::size().

template<class T>
ImageSet<T>& operator *= ImageSet< T > &  x,
const T &  v
 

x *= v, for each image in x

Definition at line 316 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator *= ImageSet< T > &  x,
const Image< T > &  y
 

x *= y, for each image in x; requires isHomogeneous(x).

Definition at line 272 of file ImageSetOps.C.

template<class T>
ImageSet<T> operator+ ImageSet< T > &  x,
const T &  v
 

x + v, for each image in x

Definition at line 344 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator+= ImageSet< T > &  x,
const ImageSet< T > &  y
 

x += y, for each image in x with the respective image in y

Definition at line 380 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator+= ImageSet< T > &  x,
const T &  v
 

x += v, for each image in x

Definition at line 306 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator+= ImageSet< T > &  x,
const Image< T > &  y
 

x += y, for each image in x; requires isHomogeneous(x).

Definition at line 260 of file ImageSetOps.C.

template<class T>
ImageSet<T> operator- ImageSet< T > &  x,
const T &  v
 

x - v, for each image in x

Definition at line 336 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator-= ImageSet< T > &  x,
const ImageSet< T > &  y
 

x -= y, for each image in x with the respective image in y

Definition at line 368 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator-= ImageSet< T > &  x,
const T &  v
 

x -= v, for each image in x

Definition at line 296 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator-= ImageSet< T > &  x,
const Image< T > &  y
 

x -= y, for each image in x; requires isHomogeneous(x).

Definition at line 248 of file ImageSetOps.C.

template<class T>
ImageSet<T> operator/ ImageSet< T > &  x,
const T &  v
 

x / v, for each image in x

Definition at line 360 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator/= ImageSet< T > &  x,
const ImageSet< T > &  y
 

x /= y, for each image in x with the respective image in y

Definition at line 404 of file ImageSetOps.C.

References ASSERT, i, and ImageSet< T >::size().

template<class T>
ImageSet<T>& operator/= ImageSet< T > &  x,
const T &  v
 

x /= v, for each image in x

Definition at line 326 of file ImageSetOps.C.

template<class T>
ImageSet<T>& operator/= ImageSet< T > &  x,
const Image< T > &  y
 

x /= y, for each image in x; requires isHomogeneous(x).

Definition at line 284 of file ImageSetOps.C.

template<class T>
Range<T> rangeOf const ImageSet< T > &  x  ) 
 

Returns the overall range of all images in the set.

Definition at line 120 of file ImageSetOps.C.

Referenced by buildPyrRetinexLog(), buildTitle(), doOneNormalize(), BackpropLearner::getBiasMap(), FourierFeatureExtractor::illustrate(), Image_xx_rangeOf_xx_1(), Image_xx_rangeOf_xx_2(), Image_xx_sepFilter_xx_1(), Image_xx_sepFilter_xx_3(), Image_xx_sepFilter_xx_4(), Image_xx_sepFilter_xx_5(), inspect(), main(), makeSumoDisplay(), normalizeFloat(), rangeOf(), and stainImg().

template<class T>
ImageSet<T> reduce const ImageSet< T > &  x,
int  octaves
 

Make a new ImageSet by downscaling the input by the given number of octaves.

Definition at line 192 of file ImageSetOps.C.

References decXY(), i, lowPass3(), n, and ImageSet< T >::size().

Referenced by ContourChannel::doInput(), and main().

template<class T>
ImageSet<T> rescale const ImageSet< T > &  x,
const Dims dims
 

Make a new ImageSet by rescaling each input image to the given dimensions.

Definition at line 210 of file ImageSetOps.C.

Referenced by addNoise(), POMDP::bayesFilter(), BiasValImage::BiasValImage(), InferoTemporalSalBayes::buildRawDV(), DescriptorVec::buildRawDV(), MotionEnergyPyrBuilder< T >::buildVerticalMotionLevel(), Geons3D::calcGeonLikelihood(), CT2WSRegionTrainerForm::ChangeFrame(), CINNICstatsRun::checkSize(), SoxChannel::combineOutputs(), SubmapAlgorithmBiased::compute(), ContourLayer::compute(), SimulationViewerStats::computeAGStats(), ComputeCMAP(), SimulationViewerStats::computeLAMStats(), DirectFeedChannel::computeOutput(), TaskRelevanceMapTigs2::decode(), TaskRelevanceMapTigs::decode(), MbariResultViewer::displayImage(), ObjDetChannel::doInput(), ForegroundDetectionChannel::doInput(), ContourChannel::doInput(), doRescale(), doResizeImage(), SimulationViewerNerdCam::drawMegaCombo(), contourRun::dumpEnergySigmoid(), ENV_SHOWIMG(), SMap::evolve(), ObjRecSalBayes::evolveBrain(), CT2WSRegionTrainerForm::fileOpen(), TemplateMatchChannel::findBestMatch(), PyrFoveator::foveate(), TestImages::generateScene(), SMap::getDebugImage(), Geons3D::getDebugImage(), SubController::getImage(), VisualObject::getKeypointImage(), VisualObject::getKeypointImage2(), SceneGenerator::getLabelMeScene(), EnvSaliencyMap::getSalmap(), GetSaliency::getSubMaps(), PyramidFeatureExtractor::illustrate(), Image_xx_rescale_xx_1(), Image_xx_rescale_xx_2(), Image_xx_rescale_xx_3(), Image_xx_rescale_xx_4(), Image_xx_rescale_xx_5(), ImageInfo::ImageInfo(), VisualBufferStd::input(), TaskRelevanceMapTigs2::inputFrame(), TaskRelevanceMapTigs2::integrate(), TaskRelevanceMapTigs::integrate(), TaskRelevanceMapGistClassify::integrate(), main(), makeSumoDisplay(), maxNormalizeFancy(), maxNormalizeFancyFast(), mexFunction(), myDownSize(), ImageCanvas::paintEvent(), POMDP::particleFilter(), SingleChannel::postProcessMap(), ObjRecSPM::predict(), CINNICstatsRun::preProcess(), XMLInput::readFrame(), GameOfLifeInput::readFrame(), InputMbariFrameSeries::readRGB(), rescale(), SimulationViewerI::run(), MissileLauncher::run(), SimulationViewerNerdCam::saveResults(), SurpriseMapFFT< T >::setFFTModels(), BiasImageForm::showSMap(), testALOI(), Context::testFrame(), BeobotBrainMT::threadCompute(), ObjRecSPM::train(), ObjRecHMax::train(), trainALOI(), trainTestALOI(), BiasValImage::updateValues(), OptimalGainsFinder::visitComplexChannel(), OptimalGainsFinder::visitSingleChannel(), and warp3Dmap().

template<class T>
Image<T> sum const ImageSet< T > &  x  ) 
 

Returns the sum of all the images in the set. Requires isHomogeneous().

Definition at line 95 of file ImageSetOps.C.

template<class T>
ImageSet<T> takeSlice const ImageSet< T > *  sets,
uint  N,
uint  s
 

Make an ImageSet from the s'th level from each of the N input sets.

This is useful, for example, in transforming an array of ImageSets from multiple-scales-per-set/one-orientation-per-set into the reverse, multiple-orientations-per-set/one-scale-per-set.

Definition at line 134 of file ImageSetOps.C.

References i.

Referenced by ContourChannel::doInput().


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