Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 75712081bb
Fetching contributors…

Cannot retrieve contributors at this time

73 lines (57 sloc) 1.99 KB
* MultiCameraDistance.h
* SfMToyExample
* Created by Roy Shilkrot on 3/27/12.
* Copyright 2012 MIT. All rights reserved.
#pragma once
#include <opencv2/opencv.hpp>
#include <vector>
#include <utility>
#include "IDistance.h"
#include "Triangulation.h"
#include "IFeatureMatcher.h"
#include "FindCameraMatrices.h"
class MultiCameraDistance : public IDistance {
std::vector<std::vector<cv::KeyPoint> > imgpts;
std::vector<std::vector<cv::KeyPoint> > fullpts;
std::vector<std::vector<cv::KeyPoint> > imgpts_good;
std::map<std::pair<int,int> ,std::vector<cv::DMatch> > matches_matrix;
std::vector<cv::Mat_<cv::Vec3b> > imgs_orig;
std::vector<cv::Mat> imgs;
std::vector<std::string> imgs_names;
std::map<int,cv::Matx34d> Pmats;
cv::Mat K;
cv::Mat_<double> Kinv;
cv::Mat cam_matrix,distortion_coeff;
cv::Mat distcoeff_32f;
cv::Mat K_32f;
std::vector<CloudPoint> pointcloud;
std::vector<cv::Vec3b> pointCloudRGB;
std::vector<cv::KeyPoint> correspImg1Pt; //TODO: remove
cv::Ptr<IFeatureMatcher> feature_matcher;
bool features_matched;
bool use_rich_features;
bool use_gpu;
std::vector<cv::Point3d> getPointCloud() { return CloudPointsToPoints(pointcloud); }
const cv::Mat& get_im_orig(int frame_num) { return imgs_orig[frame_num]; }
const std::vector<cv::KeyPoint>& getcorrespImg1Pt() { return correspImg1Pt; }
const std::vector<cv::Vec3b>& getPointCloudRGB() { return pointCloudRGB; }
std::vector<cv::Matx34d> getCameras() {
std::vector<cv::Matx34d> v;
for(std::map<int ,cv::Matx34d>::const_iterator it = Pmats.begin(); it != Pmats.end(); ++it ) {
v.push_back( it->second );
return v;
const std::vector<cv::Mat>& imgs_,
const std::vector<std::string>& imgs_names_,
const std::string& imgs_path_);
virtual void OnlyMatchFeatures(int strategy = STRATEGY_USE_FEATURE_MATCH);
// bool CheckCoherentRotation(cv::Mat_<double>& R);
Jump to Line
Something went wrong with that request. Please try again.