This is a basic class to encode 2D integer coordinates. More...
#include <Image/Point2D.H>
Public Member Functions | |
Point2D () | |
The default constructor initializes the coordinates to (0,0). | |
Point2D (const T ii, const T jj) | |
Initialize the Point2D from horizontal & vertical coordinates. | |
Point2D (const Dims &d) | |
Initialize from a Dims object; i=w, j=h. | |
template<class U > | |
Point2D (const Point2D< U > &a) | |
Explicit conversion from type T to another type U. | |
Point2D< T > & | operator+= (const Point2D< T > &p) |
+= operator | |
Point2D< T > & | operator-= (const Point2D< T > &p) |
-= operator | |
Point2D< T > & | operator*= (const Point2D< T > &p) |
*= operator | |
Point2D< T > & | operator/= (const Point2D< T > &p) |
/= operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator+ (const Point2D< U > &p) const |
+ operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator- (const Point2D< U > &p) const |
| |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator* (const Point2D< U > &p) const |
* operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator/ (const Point2D< U > &p) const |
/ operator | |
Point2D< T > & | operator+= (const T val) |
+= operator | |
Point2D< T > & | operator-= (const T val) |
-= operator | |
Point2D< T > & | operator*= (const T val) |
*= operator | |
Point2D< T > & | operator/= (const T val) |
/= operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator+ (const U val) const |
+ operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator- (const U val) const |
| |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator* (const U val) const |
* operator | |
template<class U > | |
Point2D< typename promote_trait< T, U >::TP > | operator/ (const U val) const |
/ operator | |
bool | isValid () const |
test whether i and j are both positive | |
promote_trait< T, float >::TP | squdist (const Point2D< T > &p) const |
the square of the euclidean distance | |
promote_trait< T, float >::TP | distance (const Point2D< T > &p) const |
the euclidean distance from p | |
promote_trait< T, float >::TP | magnitude () const |
the Magnitude | |
promote_trait< T, float >::TP | distanceToLine (const Point2D< T > &p, const Point2D< T > &q, const bool getsigned=false) const |
the euclidean distance from line pq | |
promote_trait< T, float >::TP | distanceToSegment (const Point2D< T > &p, const Point2D< T > &q) const |
the euclidean distance from segment pq | |
void | clampToDims (const Dims &dims) |
clamp the coords such that the point fits into image of dimensions dims | |
Public Attributes | |
T | i |
2D coordinates | |
T | j |
This is a basic class to encode 2D integer coordinates.
This is a completely public class whose goal is just to provide a shorthand notation for 2D integer coordinates.
Definition at line 53 of file Point2D.H.
The default constructor initializes the coordinates to (0,0).
Definition at line 209 of file Point2D.H.
References Point2D< T >::i.
Initialize the Point2D from horizontal & vertical coordinates.
Definition at line 214 of file Point2D.H.
References Point2D< T >::i.
clamp the coords such that the point fits into image of dimensions dims
Definition at line 399 of file Point2D.H.
References Dims::h(), Point2D< T >::i, Dims::isEmpty(), and Dims::w().
Referenced by FrictionSaccadeController::computeWhenNewDecision(), and SimulationViewerCompress::getTraj().
promote_trait< T, float >::TP Point2D< T >::distance | ( | const Point2D< T > & | p | ) | const [inline] |
the euclidean distance from p
Definition at line 363 of file Point2D.H.
References sqrt(), and Point2D< T >::squdist().
Referenced by angleMeasure(), LandmarkDB::build(), TrivialSaccadeController::computeWhenNewDecision(), Point2D< T >::distanceToSegment(), VisualBufferStd::findMostInterestingTargetLocMax(), LineGrouping::getLocalLines(), VisualObjectMatch::getSalDist(), BeoSubBin::getWeightedBinMass(), SimulationViewerNerdCam::linkFOAs(), SimulationViewerStd::linkFOAs(), Beobot2_GistSalLocalizerMasterI::objectUpdateBelief(), GSlocalizer::objectUpdateBelief(), TopologicalMap::read(), GSlocalizer::setLocation(), Beobot2_GistSalLocalizerMasterI::setLocation(), and trackPoint().
promote_trait< T, float >::TP Point2D< T >::distanceToLine | ( | const Point2D< T > & | p, | |
const Point2D< T > & | q, | |||
const bool | getsigned = false | |||
) | const [inline] |
the euclidean distance from line pq
Definition at line 375 of file Point2D.H.
References Point2D< T >::i, and sqrt().
Referenced by Point2D< T >::distanceToSegment().
promote_trait< T, float >::TP Point2D< T >::distanceToSegment | ( | const Point2D< T > & | p, | |
const Point2D< T > & | q | |||
) | const [inline] |
the euclidean distance from segment pq
Definition at line 388 of file Point2D.H.
References Point2D< T >::distance(), Point2D< T >::distanceToLine(), and Point2D< T >::i.
bool Point2D< T >::isValid | ( | ) | const [inline] |
test whether i and j are both positive
Definition at line 347 of file Point2D.H.
References Point2D< T >::i.
Referenced by ThresholdFrictionSaccadeController::computeWhenNewDecision(), MonkeySaccadeController::computeWhenNewDecision(), ThresholdSaccadeController::computeWhenNewDecision(), TrivialSaccadeController::computeWhenNewDecision(), FixedSaccadeController::computeWhenNewDecision(), ThresholdFrictionSaccadeController::computeWhenNewPercept(), GHough::createInvRTable(), SimulationViewerStd::drawEye(), SimulationViewerStd::drawHead(), RG_Lane::evolve(), Ganglion::getDebugImage(), SaccadeController::getDecision(), GHough::getInvVotes(), RetinaAdapter::getOutput(), WinnerTakeAllGreedy::integrate(), WTAwinner::isValid(), SimulationViewerStd::linkEyes(), SimulationViewerStd::linkHeads(), main(), SaccadeController::resetPos(), VisualTracker::setTargets(), SimulationViewerEyeSim::stop1(), and SimOutputFrameSeries::update().
promote_trait< T, float >::TP Point2D< T >::magnitude | ( | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator* | ( | const U | val | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator* | ( | const Point2D< U > & | p | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator+ | ( | const U | val | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator+ | ( | const Point2D< U > & | p | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator- | ( | const U | val | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator- | ( | const Point2D< U > & | p | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator/ | ( | const U | val | ) | const [inline] |
Point2D< typename promote_trait< T, U >::TP > Point2D< T >::operator/ | ( | const Point2D< U > & | p | ) | const [inline] |
promote_trait< T, float >::TP Point2D< T >::squdist | ( | const Point2D< T > & | p | ) | const [inline] |
the square of the euclidean distance
Definition at line 353 of file Point2D.H.
References Point2D< T >::i.
Referenced by ThresholdSaccadeController::checkPercepts(), ThresholdSaccadeController::computeWhenNewDecision(), and Point2D< T >::distance().
2D coordinates
Definition at line 150 of file Point2D.H.
Referenced by GeometricHashing::addModel(), angle(), LineSegment2D::angle(), angleMeasure(), approximateHull(), InferoTemporalSIFT::attentionShift(), LandmarkDB::build(), DescriptorVec::buildDV(), WTAwinner::buildFromSMcoords(), DescriptorVec::buildParticleCountDV(), DescriptorVec::buildRawDV(), DescriptorVec::buildSingleChannelFV(), CudaSaliency::calcInertia(), JunctionHOG::calculateJunctionHistogram(), Rectangle::centerDims(), ThresholdSaccadeController::checkPercepts(), SceneGenerator::checkTargetPos(), Point2D< T >::clampToDims(), cMapLearnProc(), cMapLeftBiasProc(), SurpriseModelOD::combineFrom(), SurpriseModelPM::combineFrom(), SceneRec::computeLocation(), FrictionSaccadeController::computeWhenNewPercept(), FrictionSaccadeController::computeWhenResetPos(), Rectangle::contains(), convertFromString(), convertToString(), DPM::convolveComponent(), Image< T >::coordsOk(), CudaImage< T >::coordsOk(), corrpatch(), countParticles(), GHough::createInvRTable(), GHough::createRTable(), SpaceVariantModule::cropTransform(), cudaCrop(), cudaInplaceOverlay(), cudaInplacePaste(), SpatialMetrics::deg2pix(), SaliencyMapStdOptim::depress(), SaliencyMapFast::depress(), SaliencyMapTrivial::depress(), SaliencyMapStd::depress(), dilateImg(), PsychoDisplay::displayEyeTrackerCalibration(), SDLdisplay::displayImagePatch(), HippocampusI::displayMap(), PsychoDisplay::displayMovingDotBackground(), PsychoDisplay::displayNumbers(), PsychoDisplay::displaySmoothPursuitCalibration(), SDLdisplay::displayText(), Point2D< T >::distanceToLine(), Point2D< T >::distanceToSegment(), distDegrade(), FrictionSaccadeController::doEvolve(), ScorrChannel::doInput(), ObjDetChannel::doInput(), drawDiskCheckTarget(), SimulationViewerStd::drawEye(), ViewPort3D::drawGround(), SimulationViewerHand::drawHand(), SimulationViewerEyeHand::drawHand(), SimulationViewerStd::drawHead(), SimulationViewerStd::drawMaskOutline(), SimulationViewerNerdCam::drawMaskOutline(), CudaFramework::drawRectangle_centrepoint(), TemplateMatchChannel::drawResults(), drawSuperquadric(), VisualEventSet::drawTokens(), SaccadeController::dumpQueues(), erodeImg(), InferotemporalCortexI::evolve(), RG_Lane::evolve(), BeoLRF::evolve(), SceneUnderstanding::evolveBrain(), filterAtLocation(), TemplateMatchChannel::findBestMatch(), findBoundingRect(), GeometricHashing::findInHash(), findMax(), findMin(), VisualBufferStd::findMostInterestingTargetLocMax(), fixationMask(), flood(), floodCleanBB(), PyrFoveator::foveate(), BlurFoveator::foveate(), SpaceVariantModule::fromSvCoords(), SpaceVariantModule::fromSvCoordsMap(), gaussianBlob(), gaussianBlobUnnormalized(), KeypointTracker::getAbsLoc(), Graph::getAngle(), Beobot2_GistSalLocalizerMasterI::getBeliefImage(), GSlocalizer::getBeliefImage(), SaliencyMT::getBias(), EyeTrackerISCAN::getCalibrationSet(), ImageSpring< T >::getClusteredImage(), SaccadeController::getDecision(), EyeTrackerISCAN::getEyePos(), FeatureVector::getFeatureVectorImage(), FoeDetector::getFoe(), FoeDetector::getFoeMap(), ViewPort3D::getFrameLines(), PGH::getGeometricHistogram(), GeometricHashing::getHashTableImage(), ImageSpring< T >::getIndex(), BeobotVisualCortex::getInputSize(), SceneRecServer_i::getLandmarkLoc(), getLocalAvg(), LineGrouping::getLocalLines(), getLocalMax(), TopologicalMap::getLocationFloat(), TopologicalMap::getMapImage(), ImageSpring< T >::getNeighbor(), TestImages::getObjectData(), TestImages::getObjFromPos(), SceneGenerator::getObjFromPos(), RetinaAdapter::getOutput(), Landmark::getPosition(), RetinaAdapter::getRawInputRectangle(), VisualObject::getSalAndKeypointImage(), VisualObjectMatch::getSalDist(), SalientRegionSegmenter::getSalientRegion(), getSalRegions(), WTAwinner::getSMcoords(), VisualObjectMatch::getSpatialDist(), SimulationViewerStd::getTraj(), SimulationViewerNerdCam::getTraj(), SimulationViewerCompress::getTraj(), VisualObjectMatch::getTransfTestOutline(), Image< T >::getVal(), Image< T >::getValInterp(), Image< T >::getValInterpScaled(), VectorField::getVectorAt(), GeometricHashing::getVotes(), BeoSubBin::getWeightedBinMass(), BeobotVisualCortex::getWinner(), ImageSpring< T >::getXY(), Beobot::highLevel(), Beobot2_GistSalLocalizerMasterI::initParticles(), GSlocalizer::initParticles(), inplacePasteGabor(), WinnerTakeAllStdOptim::integrate(), WinnerTakeAllTempNote::integrate(), WinnerTakeAllGreedy::integrate(), WinnerTakeAllFast::integrate(), WinnerTakeAllStd::integrate(), Beobot::intermediateLevel(), LineSegment2D::intersects(), Camera::inverseProjection(), isLocalMax(), Point2DT::isValid(), Point2D< T >::isValid(), TestImages::labelScene(), linePlot(), Point2D< T >::magnitude(), main(), EyeTrackerEyeLink::manualDriftCorrection(), meanRow(), multilinePlot(), SurpriseImage< T >::neighborhoods(), VectorHistField::obstacleTemplate(), omniCorrectGen(), SimulationViewerEyeSim::onSimEventWTAwinner(), operator!=(), Point2D< T >::operator*(), Point2D< T >::operator*=(), Point2D< T >::operator+(), Point2D< T >::operator+=(), Point2D< T >::operator-(), Point2D< T >::operator-=(), Point2D< T >::operator/(), Point2D< T >::operator/=(), operator<<(), operator==(), operator>(), operator>>(), Image< T >::operator[](), SimEventSaliencyMapOutput::origToSm(), pasteImage(), SpatialMetrics::pix2deg(), plotData(), VectorField::plotField(), VectorField::plotGridField(), pnpoly(), pnTriangle(), Point2D< T >::Point2D(), CINNICstatsRun::pointAndFlood(), Localization::predict(), BeobotVisualCortex::process(), BeobotVisualCortex::processEnd(), Camera::project(), Vector2D::reset(), SaccadeController::resetPos(), retinalToVisualBuffer(), VectorField::rotateField(), BeoSubSaliency::run(), HeliPose::run_cameraPose(), SimulationViewerStats::save1(), segmentLandmark(), segmentObject(), segmentObjectClean(), DescriptorVec::setFovea(), Beobot2_GistSalLocalizerMasterI::setLocation(), GSlocalizer::setLocation(), setNewBias(), LPTFoveator::setOrigin(), Foveator::setOrigin(), VisualTracker::setTargets(), Image< T >::setVal(), VectorField::setVectorAt(), XWindow::setVisible(), VectorHistField::shiftField(), BeobotVisualCortex::singleCPUprocess(), SimEventSaliencyMapOutput::smToOrig(), Landmark::sort(), Point2D< T >::squdist(), SimulationViewerEyeHand::start1(), SimulationViewerEyeSim::stop1(), SimReqVCXfeatures::toString(), SimEventSaccadeStatus::toString(), SimEventWTAwinner::toString(), SpaceVariantModule::toSvCoords(), SpaceVariantModule::toSvCoordsMap(), VisualTracker::trackObjects(), trackPoint(), VisualTracker::trackTemplObject(), SceneRec::trainFeature(), SpaceVariantModule::transform(), Localization::update(), VisualEventSet::updateEvents(), VectorHistField::updateField(), Beobot2_GistSalLocalizerWorkerI::updateMessage(), Beobot2_GistSalLocalizerMasterI::updateMessage(), visualBufferToRetinal(), vizDist(), and SimulationViewerNerdCam::writeStatusPage().