#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"
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) |
Generate a set of oriented filter outputs for a given set of orientations. | |
void | splitPosNeg (const ImageSet< float > &x, ImageSet< float > &pos, ImageSet< float > &neg) |
split the positive and negative values for each image in 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 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. | |
template<class T > | |
void | doSquared (ImageSet< T > &x) |
For each image in x, take the square at every pixel. | |
void | doMeanNormalize (ImageSet< float > &x) |
Subtract the overall mean from each image. | |
void | doOneNormalize (ImageSet< float > &x) |
Normalize so overall max value is 1.0. | |
void | doEnergyNorm (ImageSet< float > &x) |
Divide image by the local image energy, then subtract overall mean. | |
void | doApplyBiases (ImageSet< float > &x, const float *biases) |
Multiply each image by the corresponding bias. | |
void | doAddWeighted (ImageSet< float > &x, const ImageSet< float > &y, float multiple) |
x += v * y, for each image in x and y, respectively | |
void | doClear (ImageSet< float > &x, float v) |
x = v, for each image in x | |
template bool | isDyadic (const ImageSet< int > &pyr) |
template ImageSet< double > & | operator/= (ImageSet< double > &x, const double &v) |
Free functions operating on sets of images
Definition in file ImageSetOps.C.
ImageSet<T> clampedDiff | ( | const ImageSet< T > & | b, | |
const ImageSet< T > & | c | |||
) | [inline] |
clampedDiff(b,c) for each image
Definition at line 424 of file ImageSetOps.C.
References ASSERT, clampedDiff(), and ImageSet< T >::size().
Referenced by clampedDiff(), ImageCacheAvg< T >::clampedDiffMean(), and OrientationChannel::doInteractions().
x += v * y, for each image in x and y, respectively
Definition at line 517 of file ImageSetOps.C.
References ASSERT, and ImageSet< T >::size().
void doApplyBiases | ( | ImageSet< float > & | x, | |
const float * | biases | |||
) |
Multiply each image by the corresponding bias.
Definition at line 508 of file ImageSetOps.C.
References ImageSet< T >::size().
void doClear | ( | ImageSet< float > & | x, | |
float | v | |||
) |
x = v, for each image in x
Definition at line 525 of file ImageSetOps.C.
References ImageSet< T >::clear(), and ImageSet< T >::size().
void doEnergyNorm | ( | ImageSet< float > & | x | ) |
Divide image by the local image energy, then subtract overall mean.
Definition at line 499 of file ImageSetOps.C.
References energyNorm(), and ImageSet< T >::size().
Referenced by ContourChannel::doInput().
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 451 of file ImageSetOps.C.
References inplaceLowThresh(), and ImageSet< T >::size().
Referenced by SingleChannel::computePyramid(), SingleSvChannel::computePyramid(), OrientationChannel::doInteractions(), and SingleChannel::setClipPyramid().
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 459 of file ImageSetOps.C.
References inplaceLowThreshAbs(), and ImageSet< T >::size().
Referenced by SingleChannel::computePyramid(), and SingleSvChannel::computePyramid().
void doMeanNormalize | ( | ImageSet< float > & | x | ) |
Subtract the overall mean from each image.
Definition at line 482 of file ImageSetOps.C.
References mean().
Referenced by ContourChannel::doInput().
void doOneNormalize | ( | ImageSet< float > & | x | ) |
Normalize so overall max value is 1.0.
Definition at line 488 of file ImageSetOps.C.
References Range< T >::max(), rangeOf(), and ImageSet< T >::size().
Referenced by ContourChannel::doInput().
void doRectify | ( | ImageSet< T > & | x | ) | [inline] |
x = rectify(x), for each image in x
Definition at line 443 of file ImageSetOps.C.
References inplaceRectify(), and ImageSet< T >::size().
Referenced by SingleChannel::computePyramid(), SingleSvChannel::computePyramid(), and ContourChannel::doInput().
void doSqrt | ( | ImageSet< T > & | x | ) | [inline] |
For each image in x, take the square root at every pixel.
Definition at line 467 of file ImageSetOps.C.
References ImageSet< T >::size(), and sqrt().
Referenced by DirectionChannel::computePyramid().
void doSquared | ( | ImageSet< T > & | x | ) | [inline] |
For each image in x, take the square at every pixel.
Definition at line 475 of file ImageSetOps.C.
References ImageSet< T >::size(), and squared().
Image<T> makeImageArray | ( | const ImageSet< T > & | x, | |
int | Nx = -1 , |
|||
int | grid_width = 1 , |
|||
T | grid_color = T() , |
|||
int | destX = -1 , |
|||
int | destY = -1 | |||
) | [inline] |
Make a single image-array from the set (see concatArray() in Image_ShapeOps).
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(), isDyadic(), ImageSet< T >::size(), sqrt(), and zoomXY().
Referenced by ContourChannel::doInput().
Returns the sum of all the images in the set. Requires isHomogeneous().
Definition at line 111 of file ImageSetOps.C.
References ImageSet< T >::size(), and sum().
Referenced by addNoise(), dogFilterHmax(), MultiColorBandChannel::doInput(), VarianceChannel::doInput(), OrientationChannel::doInteractions(), doMeanNormalize(), covEstimate< T >::dumpMatrix(), energyNorm(), Beobot2GistSalMasterI::evolve(), gaborFilter3(), Bayes::import(), learningCoeff(), main(), maxNormalizeStdev0(), Localization::resample(), ScaleRemoveSurprise< FLOAT >::SRSsetAntiWeights(), ObjRec::start2(), stdev(), and Beobot2_GistSalLocalizerMasterI::updateMessage().
x * v, for each image in x
Definition at line 360 of file ImageSetOps.C.
x *= y, for each image in x with the respective image in y
Definition at line 400 of file ImageSetOps.C.
References ASSERT, and ImageSet< T >::size().
x *= v, for each image in x
Definition at line 324 of file ImageSetOps.C.
References ImageSet< T >::size().
x *= y, for each image in x; requires isHomogeneous(x).
Definition at line 280 of file ImageSetOps.C.
References ASSERT, isHomogeneous(), and ImageSet< T >::size().
x + v, for each image in x
Definition at line 352 of file ImageSetOps.C.
x += y, for each image in x with the respective image in y
Definition at line 388 of file ImageSetOps.C.
References ASSERT, and ImageSet< T >::size().
x += v, for each image in x
Definition at line 314 of file ImageSetOps.C.
References ImageSet< T >::size().
x += y, for each image in x; requires isHomogeneous(x).
Definition at line 268 of file ImageSetOps.C.
References ASSERT, isHomogeneous(), and ImageSet< T >::size().
x - v, for each image in x
Definition at line 344 of file ImageSetOps.C.
x -= y, for each image in x with the respective image in y
Definition at line 376 of file ImageSetOps.C.
References ASSERT, and ImageSet< T >::size().
x -= v, for each image in x
Definition at line 304 of file ImageSetOps.C.
References ImageSet< T >::size().
x -= y, for each image in x; requires isHomogeneous(x).
Definition at line 256 of file ImageSetOps.C.
References ASSERT, isHomogeneous(), and ImageSet< T >::size().
x / v, for each image in x
Definition at line 368 of file ImageSetOps.C.
x /= y, for each image in x with the respective image in y
Definition at line 412 of file ImageSetOps.C.
References ASSERT, and ImageSet< T >::size().
x /= v, for each image in x
Definition at line 334 of file ImageSetOps.C.
References ImageSet< T >::size().
x /= y, for each image in x; requires isHomogeneous(x).
Definition at line 292 of file ImageSetOps.C.
References ASSERT, isHomogeneous(), and ImageSet< T >::size().
ImageSet<float> orientedFilterSet | ( | const Image< float > & | lowPassedInput, | |
float | period, | |||
const float * | angles, | |||
const uint | numAngles | |||
) |
Generate a set of oriented filter outputs for a given set of orientations.
Caller is responsible for passing input in the form of (image - lowPass(image))
Definition at line 223 of file ImageSetOps.C.
References orientedFilter().
Referenced by ContourChannel::doInput().
Returns the overall range of all images in the set.
Definition at line 120 of file ImageSetOps.C.
References Range< T >::merge(), rangeOf(), and ImageSet< T >::size().
Referenced by buildPyrRetinexLog(), doOneNormalize(), normalizeFloat(), and rangeOf().
Make a new ImageSet by downscaling the input by the given number of octaves.
Definition at line 192 of file ImageSetOps.C.
References decXY(), lowPass3(), and ImageSet< T >::size().
Referenced by ContourChannel::doInput().
Make a new ImageSet by rescaling each input image to the given dimensions.
Definition at line 210 of file ImageSetOps.C.
References rescale(), and ImageSet< T >::size().
Referenced by addNoise(), DescriptorVec::buildRawDV(), CINNICstatsRun::checkSize(), SoxChannel::combineOutputs(), SubmapAlgorithmBiased::compute(), SimulationViewerStats::computeAGStats(), SimulationViewerStats::computeLAMStats(), DirectFeedChannel::computeOutput(), MbariResultViewer::displayImage(), ObjDetChannel::doInput(), ForegroundDetectionChannel::doInput(), ContourChannel::doInput(), SimulationViewerNerdCam::drawMegaCombo(), contourRun::dumpEnergySigmoid(), TemplateMatchChannel::findBestMatch(), PyrFoveator::foveate(), TestImages::generateScene(), VisualObject::getKeypointImage(), VisualObject::getKeypointImage2(), SceneGenerator::getLabelMeScene(), DPM::getModelImage(), GetSaliency::getSubMaps(), VisualBufferStd::input(), TaskRelevanceMapSocial::inputFrame(), TaskRelevanceMapTigs2::inputFrame(), TaskRelevanceMapTigs2::integrate(), TaskRelevanceMapGistClassify::integrate(), TaskRelevanceMapTigs::integrate(), main(), maxNormalizeFancy(), maxNormalizeFancyFast(), SingleChannel::postProcessMap(), CINNICstatsRun::preProcess(), XMLInput::readFrame(), GameOfLifeInput::readFrame(), InputMbariFrameSeries::readRGB(), rescale(), SimulationViewerNerdCam::saveResults(), SingleSvChannel::setClipPyramid(), BeobotBrainMT::threadCompute(), OptimalGainsFinder::visitComplexChannel(), OptimalGainsFinder::visitSingleChannel(), and warp3Dmap().
split the positive and negative values for each image in x
Definition at line 240 of file ImageSetOps.C.
References ImageSet< T >::size(), and splitPosNeg().
Referenced by splitPosNeg().
Returns the sum of all the images in the set. Requires isHomogeneous().
Definition at line 95 of file ImageSetOps.C.
References ASSERT, isHomogeneous(), ImageSet< T >::size(), and ZEROS.
Referenced by DirectFeedChannel::absSumCoeffs(), lobot::PointMatrix::average(), lobot::LRFData::average_distance(), HMM< T >::backward(), c_intg_x_filter_clean_fewbits(), c_intg_x_filter_clean_manybits(), c_intg_x_filter_clean_small_fewbits(), c_intg_x_filter_clean_small_manybits(), c_intg_y_filter_clean_fewbits(), c_intg_y_filter_clean_manybits(), c_intg_y_filter_clean_small_fewbits(), c_intg_y_filter_clean_small_manybits(), PGH::cmpHist(), TaskRelevanceMapGistClassify::computeGistDist(), GistEstimatorFFT::computeGistFeatureVector(), VisualObject::computeKeypoints(), convolveCleanZero(), convolveHmax(), BitObject::doesIntersect(), dogFilterHmax(), VarianceChannel::doInput(), Gist_Navigation::evolve(), filterAtLocation(), filterAtLocationBatch(), HMM< T >::forward(), getCentroidFirstLast(), Histogram::getChiSqDiff(), Histogram::getDistance(), getEdgeScaleSpacePixel(), getLikelyhoodImage(), getMaskedMinMaxAvg(), SpectralResidualChannel::getOutput(), learningCoeff(), lowPassPixel(), main(), mean(), multiScaleBatchFilter(), ComplexChannel::numSubmaps(), IntegerComplexChannel::numSubmaps(), SimEventShapeEstimatorOutput::objectArea(), randomDoubleFromNormal(), SalientRegionSegmenter::SalientRegionSegmenter(), ScaleSpace::ScaleSpace(), segmentLandmark(), BitObject::setMaxMinAvgIntensity(), ObjRec::start2(), stdev(), sumXY(), HippocampusI::updateParticleObservation(), HippocampusI::updateParticleSlamObservation(), WeightFinder::visitComplexChannel(), WeightFinder::visitSingleChannel(), and HmaxFL::windowedPatchDistance().
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.
Referenced by ContourChannel::doInput().