NASA Astrobee Robot Software  Astrobee Version:
Flight software for the Astrobee robots operating inside the International Space Station.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
nvm_visualize.cc File Reference
#include <ff_common/init.h>
#include <ff_common/utils.h>
#include <camera/camera_model.h>
#include <sparse_mapping/reprojection.h>
#include <sparse_mapping/sparse_map.h>
#include <sparse_mapping/sparse_mapping.h>
#include <camera/camera_params.h>
#include <Eigen/Geometry>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <opencv2/core/eigen.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/viz/vizcore.hpp>
#include <boost/filesystem.hpp>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
Include dependency graph for nvm_visualize.cc:

Classes

struct  MapViewerState
 

Functions

 DEFINE_bool (only_poses, false, "Only view camera poses in 3D.")
 
 DEFINE_bool (jump_to_3d_view, false, "Skip displaying images and features, go directly to the 3D view.")
 
 DEFINE_bool (skip_3d_points, false, "Show just the cameras in 3D space, without the triangulated points.")
 
 DEFINE_bool (only_3d_points, false, "Show just the the triangulated points.")
 
 DEFINE_bool (skip_3d_images, false, "Show just the camera wireframes instead of the camera images in the 3D view.")
 
 DEFINE_bool (fit_view_to_points_bdbox, false, "Zoom just enough to see all points in the cloud.")
 
 DEFINE_bool (plot_matches, false, "For each feature, also plot (in red) its match in the next image.")
 
 DEFINE_bool (enable_image_deletion, false, "When viewing only images, so without a map, enable deleting the currently " "seen image with the Del key.")
 
 DEFINE_int32 (first, 0, "The index of the first image to plot in the 3D view.")
 
 DEFINE_int32 (last, std::numeric_limits< int >::max(), "The index after the last image to plot in the 3D view.")
 
 DEFINE_double (scale, 0.5, "The scale of images in the 3D view.")
 
cv::Affine3f EigenToCVAffine (const Eigen::Affine3d &e)
 
void Draw3DFrame (cv::viz::Viz3d *window, const sparse_mapping::SparseMap &map, int cid, cv::Vec3f const &center)
 
bool LocalizeFrame (MapViewerState *state, int frame)
 
int remainder (int cid, int num)
 
void Recenter ()
 
void KeyboardCallback (const cv::viz::KeyboardEvent &event, void *param)
 
static void onMouse (int event, int x, int y, int, void *)
 
std::shared_ptr< sparse_mapping::SparseMapmap_with_no_features (int argc, char **argv)
 
void deleteImageFromDiskAndMap (sparse_mapping::SparseMap &map, std::string const &image_name)
 
bool file_exists (const std::string &name)
 
int main (int argc, char **argv)
 

Variables

std::shared_ptr< sparse_mapping::SparseMapg_map_ptr
 
cv::viz::Viz3d * g_win_ptr
 
int g_cid
 
cv::Mat * g_image
 
std::string * g_windowName
 
std::vector< std::string > g_openWindows
 

Function Documentation

◆ DEFINE_bool() [1/8]

DEFINE_bool ( enable_image_deletion  ,
false  ,
"When viewing only  images,
so without a  map,
enable deleting the currently " "seen image with the Del key."   
)

◆ DEFINE_bool() [2/8]

DEFINE_bool ( fit_view_to_points_bdbox  ,
false  ,
"Zoom just enough to see all points in the cloud."   
)

◆ DEFINE_bool() [3/8]

DEFINE_bool ( jump_to_3d_view  ,
false  ,
"Skip displaying images and  features,
go directly to the 3D view."   
)

◆ DEFINE_bool() [4/8]

DEFINE_bool ( only_3d_points  ,
false  ,
"Show just the the triangulated points."   
)

◆ DEFINE_bool() [5/8]

DEFINE_bool ( only_poses  ,
false  ,
"Only view camera poses in 3D."   
)

◆ DEFINE_bool() [6/8]

DEFINE_bool ( plot_matches  ,
false  ,
"For each  feature,
also plot(in red) its match in the next image."   
)

◆ DEFINE_bool() [7/8]

DEFINE_bool ( skip_3d_images  ,
false  ,
"Show just the camera wireframes instead of the camera images in the 3D view."   
)

◆ DEFINE_bool() [8/8]

DEFINE_bool ( skip_3d_points  ,
false  ,
"Show just the cameras in 3D  space,
without the triangulated points."   
)

◆ DEFINE_double()

DEFINE_double ( scale  ,
0.  5,
"The scale of images in the 3D view."   
)

◆ DEFINE_int32() [1/2]

DEFINE_int32 ( first  ,
,
"The index of the first image to plot in the 3D view."   
)

◆ DEFINE_int32() [2/2]

DEFINE_int32 ( last  ,
std::numeric_limits< int >  ::max(),
"The index after the last image to plot in the 3D view."   
)

◆ deleteImageFromDiskAndMap()

void deleteImageFromDiskAndMap ( sparse_mapping::SparseMap map,
std::string const &  image_name 
)

◆ Draw3DFrame()

void Draw3DFrame ( cv::viz::Viz3d *  window,
const sparse_mapping::SparseMap map,
int  cid,
cv::Vec3f const &  center 
)

◆ EigenToCVAffine()

cv::Affine3f EigenToCVAffine ( const Eigen::Affine3d &  e)

◆ file_exists()

bool file_exists ( const std::string &  name)

◆ KeyboardCallback()

void KeyboardCallback ( const cv::viz::KeyboardEvent &  event,
void *  param 
)

◆ LocalizeFrame()

bool LocalizeFrame ( MapViewerState state,
int  frame 
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ map_with_no_features()

std::shared_ptr<sparse_mapping::SparseMap> map_with_no_features ( int  argc,
char **  argv 
)

◆ onMouse()

static void onMouse ( int  event,
int  x,
int  y,
int  ,
void *   
)
static

◆ Recenter()

void Recenter ( )

◆ remainder()

int remainder ( int  cid,
int  num 
)

Variable Documentation

◆ g_cid

int g_cid

◆ g_image

cv::Mat* g_image

◆ g_map_ptr

std::shared_ptr<sparse_mapping::SparseMap> g_map_ptr

◆ g_openWindows

std::vector<std::string> g_openWindows

◆ g_win_ptr

cv::viz::Viz3d* g_win_ptr

◆ g_windowName

std::string* g_windowName