2#include "OrbSLAM/Headers/MapPoint.h"
3#include "OrbSLAM/Headers/Frame.h"
4#include "GraphOptimization/Headers/GeometricCamera.h"
53 Eigen::Matrix<fltp04, 3, 1> P = pMP->worldPos();
61 const fltp04 invz = 1.0f / pcz;
76 const fltp04 max_distance = pMP->GetMaxDistanceInvariance();
77 const fltp04 min_distance = pMP->GetMinDistanceInvariance();
78 const Eigen::Vector3<g_type> PO = P - frame.
cameraCenter();
79 const g_type dist = PO.norm();
81 if (dist < min_distance || dist > max_distance)
85 Eigen::Vector3<g_type> Pn = pMP->GetNormal();
87 mTrackViewCos = PO.dot(Pn) / dist;
89 if (mTrackViewCos < view_cos_limit)
93 track_scale_level = pMP->predictScale(dist, frame);
104 track_scale_level = Constant<uint04>::Invalid;
122 Eigen::Vector3f P = pMP->worldPos();
124 Eigen::Vector3f mt, twc;
130 Eigen::Matrix3f Rrl = mTrl.rotationMatrix();
132 Eigen::Vector3f trl = mTrl.translation();
134 mt = Rrl * frame.
tcw() + trl;
145 Eigen::Vector3f Pc = mR * P + mt;
146 const float Pc_dist = Pc.norm();
147 const float& PcZ = Pc(2);
162 const Eigen::Vector3f PO = P - twc;
163 const float dist = PO.norm();
165 if (dist < pMP->GetMinDistanceInvariance())
167 if (dist > pMP->GetMaxDistanceInvariance())
171 Eigen::Vector3f Pn = pMP->GetNormal();
173 const float viewCos = PO.dot(Pn) / dist;
175 if (viewCos < viewingCosLimit)
179 const uint04 nPredictedLevel = pMP->predictScale(dist, frame);
193 track_scale_level = nPredictedLevel;
194 mTrackViewCos = viewCos;
Represents a single image frame with extracted features and pose information.
const Eigen::Matrix< g_type, 3, 1 > & tcw() const
Returns the camera-to-world translation.
Eigen::Vector3< g_type > inRefCoordinates(Eigen::Vector3< g_type > pCw) const
Transforms a world-coordinate point into this frame's camera coordinates.
Sophus::SE3< g_type > GetRelativePoseTrl() const
Returns the relative pose from right to left camera.
FrameView * m_view[2]
Left [0] and right [1] view data.
virtual Eigen::Matrix3< g_type > GetRotation() const
Returns the camera rotation matrix (camera-to-world).
const FrameInfo & info() const
Returns the shared frame info.
const Eigen::Vector3< g_type > & cameraCenter() const
Returns the camera center in world coordinates.
Eigen::Vector3< g_type > GetRelativePoseTlr_translation() const
Returns the translation component of the left-to-right relative pose.
virtual cv::Point2f project(const cv::Point3f &p3D)=0
Projects a 3D point to 2D image coordinates (cv::Point3f overload).
A 3D point in the SLAM map observed by multiple keyframes.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
static constexpr bool IsInvalid(const Angle< t_type > &value)
Checks whether the given Angle holds an invalid value.
float mbf
Stereo baseline multiplied by fx.
Bounds< 2, fltp04 > image_bounds
Undistorted image bounds.
uint04 keypoint_count
Number of overlapping keypoints.
GeometricCamera * camera
Camera model for this view.
float mTrackDepth
Depth in the left camera.
float mTrackProjX
Projected x coordinate in the left image.
MapPoint * reference
The map point being projected.
bool isInFrustumChecks(const Frame &frame, MapPoint *pMP, float viewingCosLimit, bool bRight=false)
Checks frustum visibility for a single view (left or right).
bool mbTrackInViewR
Whether the point is visible in the right view.
bool checkInFrustum(const Frame &frame, MapPoint *pMP, fltp04 view_cos_limit)
Checks whether a map point is in the camera frustum and fills tracking data.
float mTrackViewCosR
Viewing cosine angles (left and right).
float mTrackDepthR
Depth in the right camera.
float mTrackProjXR
Projected x coordinate in the right image.
uint04 track_scale_levelR
Predicted scale levels (left and right).
float mTrackProjYR
Projected y coordinate in the right image.
bool mbTrackInView
Whether the point is visible in the left view.
bool is_in_frustum
Whether the point is inside the camera frustum.
float mTrackProjY
Projected y coordinate in the left image.
MapPointProjection(const Frame &frame, MapPoint *pMP, fltp04 view_cos_limit)
Constructs a projection and checks frustum visibility.