Program Listing for File basic-visualization.h

Return to documentation for file (aslam_cv2/aslam_cv_visualization/include/aslam/visualization/basic-visualization.h)

#ifndef ASLAM_VISUALIZATION_BASIC_VISUALIZATION_H_
#define ASLAM_VISUALIZATION_BASIC_VISUALIZATION_H_

#include <vector>

#include <aslam/common/memory.h>
#include <aslam/frames/feature-track.h>
#include <aslam/frames/visual-frame.h>
#include <aslam/frames/visual-nframe.h>
#include <aslam/matcher/match.h>
#include <Eigen/Dense>
#include <opencv2/core/core.hpp>

namespace aslam_cv_visualization {

// Colors are in BGR8.
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
const cv::Scalar kBlue(255, 0, 0);
const cv::Scalar kGreen(0, 255, 0);
const cv::Scalar kBrightGreen(110, 255, 110);
const cv::Scalar kRed(0, 0, 255);
const cv::Scalar kYellow(0, 255, 255);
const cv::Scalar kTurquoise(180, 180, 0);
const cv::Scalar kBlack(0, 0, 0);
const cv::Scalar kWhite(255, 255, 255);
#endif // DOXYGEN_SHOULD_SKIP_THIS

struct ImagePositionOffset {
  size_t width;
  size_t height;
};
typedef std::vector<ImagePositionOffset> Offsets;


void visualizeKeypoints(const std::shared_ptr<const aslam::VisualNFrame>& nframe, cv::Mat* image);

template<typename MatchesWithScore>
void visualizeMatches(const aslam::VisualFrame& frame_kp1,
                      const aslam::VisualFrame& frame_k,
                      const MatchesWithScore& matches,
                      cv::Mat* image);
void visualizeMatchesWithoutScore(
    const aslam::VisualFrame& frame_kp1, const aslam::VisualFrame& frame_k,
    const aslam::Matches& matches, cv::Mat* image);


void drawKeypoints(const aslam::VisualFrame& frame, cv::Mat* image);

void drawKeypointMatches(const aslam::VisualFrame& frame_kp1,
                         const aslam::VisualFrame& frame_k,
                         const aslam::Matches& matches_kp1_k,
                         cv::Scalar color_keypoint_kp1, cv::Scalar line_color,
                         cv::Mat* image);

void assembleMultiImage(const aslam::VisualNFrame::ConstPtr& nframe,
                        cv::Mat* full_image, Offsets* offsets);

void drawFeatureTrackPatches(const aslam::FeatureTrack& track, size_t neighborhood_px,
                             cv::Mat* image);

bool drawFeatureTracksPatches(const aslam::FeatureTracks& tracks, size_t neighborhood_px,
                              size_t num_cols, cv::Mat* all_tracks_image);

bool drawFeatureTracks(const aslam::FeatureTracks& tracks, cv::Mat* image);

}  // namespace aslam_cv_visualization

#include "./basic-visualization-inl.h"

#endif  // ASLAM_VISUALIZATION_BASIC_VISUALIZATION_H_