OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VioVisualizer.hpp
Go to the documentation of this file.
1 /*********************************************************************************
2  * OKVIS - Open Keyframe-based Visual-Inertial SLAM
3  * Copyright (c) 2015, Autonomous Systems Lab / ETH Zurich
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * * Neither the name of Autonomous Systems Lab / ETH Zurich nor the names of
14  * its contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Created on: Sep 15, 2014
30  * Author: Pascal Gohl
31  * Modified: Stefan Leutenegger (s.leutenegger@imperial.ac.uk)
32  * Modified: Andreas Forster (an.forster@gmail.com)
33  *********************************************************************************/
34 
43 #ifndef INCLUDE_OKVIS_VIOVISUALIZER_HPP_
44 #define INCLUDE_OKVIS_VIOVISUALIZER_HPP_
45 
46 #include <opencv/highgui.h>
47 #include <okvis/assert_macros.hpp>
48 
49 #include <okvis/Parameters.hpp>
50 #include <okvis/MultiFrame.hpp>
51 #include <okvis/FrameTypedefs.hpp>
52 
54 namespace okvis {
55 
60  public:
61 
64  typedef std::shared_ptr<VisualizationData> Ptr;
66  std::shared_ptr<okvis::MultiFrame> currentFrames;
67  std::shared_ptr<okvis::MultiFrame> keyFrames;
69  };
70 
71  OKVIS_DEFINE_EXCEPTION(Exception, std::runtime_error)
72 
73 
77  VioVisualizer(okvis::VioParameters& parameters);
78  virtual ~VioVisualizer();
79 
84  void init(okvis::VioParameters& parameters);
89  void showDebugImages(VisualizationData::Ptr& data);
90 
98  cv::Mat drawMatches(VisualizationData::Ptr& data, size_t image_number);
99 
100  private:
107  cv::Mat drawKeypoints(VisualizationData::Ptr& data, size_t cameraIndex);
108 
111 };
112 
113 } /* namespace okvis */
114 
115 #endif /* INCLUDE_OKVIS_VIOVISUALIZER_HPP_ */
std::shared_ptr< VisualizationData > Ptr
Definition: VioVisualizer.hpp:64
cv::Mat drawKeypoints(VisualizationData::Ptr &data, size_t cameraIndex)
Circles all keypoints in the current frame and returns the result.
Definition: VioVisualizer.cpp:204
This struct contains the relevant data for visualizing.
Definition: VioVisualizer.hpp:63
void showDebugImages(VisualizationData::Ptr &data)
Show the current frames with the current keyframe and all its matches.
Definition: VioVisualizer.cpp:233
Header file for the MultiFrame class.
void init(okvis::VioParameters &parameters)
Initialise parameters. Called in constructor.
Definition: VioVisualizer.cpp:70
okvis::ObservationVector observations
Vector containing all the keypoint observations.
Definition: VioVisualizer.hpp:65
A class that does homogeneous transformations. This relates a frame A and B: T_AB; it consists of tra...
Definition: Transformation.hpp:76
std::shared_ptr< okvis::MultiFrame > keyFrames
Current keyframe.
Definition: VioVisualizer.hpp:67
#define OKVIS_DEFINE_EXCEPTION(exceptionName, exceptionParent)
Macro for defining an exception with a given parent.
Definition: assert_macros.hpp:52
This file contains some useful assert macros.
Struct to combine all parameters and settings.
Definition: Parameters.hpp:280
This class is responsible to visualize the matching results.
Definition: VioVisualizer.hpp:59
okvis::kinematics::Transformation T_WS_keyFrame
Pose of the current keyframe.
Definition: VioVisualizer.hpp:68
okvis::VioParameters parameters_
Parameters and settings.
Definition: VioVisualizer.hpp:110
This file contains struct definitions that encapsulate parameters and settings.
std::shared_ptr< okvis::MultiFrame > currentFrames
Current multiframe.
Definition: VioVisualizer.hpp:66
cv::Mat drawMatches(VisualizationData::Ptr &data, size_t image_number)
Circles all keypoints in the current frame, links the matching ones to the current keyframe and retur...
Definition: VioVisualizer.cpp:74
std::vector< Observation, Eigen::aligned_allocator< Observation > > ObservationVector
Definition: FrameTypedefs.hpp:230
This file contains useful typedefs and structs related to frames.