svo
Semi-Direct Visual Odometry
include/svo/feature.h
Go to the documentation of this file.
00001 // This file is part of SVO - Semi-direct Visual Odometry.
00002 //
00003 // Copyright (C) 2014 Christian Forster <forster at ifi dot uzh dot ch>
00004 // (Robotics and Perception Group, University of Zurich, Switzerland).
00005 //
00006 // SVO is free software: you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the Free Software
00008 // Foundation, either version 3 of the License, or any later version.
00009 //
00010 // SVO is distributed in the hope that it will be useful, but WITHOUT ANY
00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #ifndef SVO_FEATURE_H_
00018 #define SVO_FEATURE_H_
00019 
00020 #include <svo/frame.h>
00021 
00022 namespace svo {
00023 
00025 struct Feature
00026 {
00027   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00028 
00029   enum FeatureType {
00030     CORNER,
00031     EDGELET
00032   };
00033 
00034   FeatureType type;     
00035   Frame* frame;         
00036   Vector2d px;          
00037   Vector3d f;           
00038   int level;            
00039   Point* point;         
00040   Vector2d grad;        
00041 
00042   Feature(Frame* _frame, const Vector2d& _px, int _level) :
00043     type(CORNER),
00044     frame(_frame),
00045     px(_px),
00046     f(frame->cam_->cam2world(px)),
00047     level(_level),
00048     point(NULL),
00049     grad(1.0,0.0)
00050   {}
00051 
00052   Feature(Frame* _frame, const Vector2d& _px, const Vector3d& _f, int _level) :
00053     type(CORNER),
00054     frame(_frame),
00055     px(_px),
00056     f(_f),
00057     level(_level),
00058     point(NULL),
00059     grad(1.0,0.0)
00060   {}
00061 
00062   Feature(Frame* _frame, Point* _point, const Vector2d& _px, const Vector3d& _f, int _level) :
00063     type(CORNER),
00064     frame(_frame),
00065     px(_px),
00066     f(_f),
00067     level(_level),
00068     point(_point),
00069     grad(1.0,0.0)
00070   {}
00071 };
00072 
00073 } // namespace svo
00074 
00075 #endif // SVO_FEATURE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines