This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> // Needed for printf etc | |
#include <objbase.h> // Needed for COM functionality | |
#include "xsens_cmt_static.h" | |
#include <conio.h> // included for _getch and _kbhit | |
#include <string.h> | |
#include <time.h> | |
#include <iostream> | |
#include <math.h> | |
#include <cv.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//you shall need opencv and/or armadillo libs | |
//you may need to load 'kStringManip.h' | |
Mat loadMatrixFromXML(string filename) | |
{ | |
Mat m; | |
FileStorage fs(filename, FileStorage::READ); | |
fs[subsBefChar(filename,".")] >> m; | |
fs.release(); | |
return m; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string subsAfLChar(string input,string character) | |
{ | |
//return the string after the last occur. of the specified character | |
int pos = input.rfind(character); | |
if(pos != -1) | |
{ | |
return input.substr(pos+1,string::npos); | |
} | |
else {return "";} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<cv::Point2f> objectPoints_(int h_,int v_,double lenght) | |
{ | |
//function to return a list of object points, giving the parameters of a checkerboard | |
std::vector<cv::Point2f> object_points; | |
cv::Point2f temp; | |
for (int i=0;i<v_;i++) | |
{ | |
for (int j=0;j<h_;j++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string dateTimeString() | |
{ | |
//return a string with the date and time | |
time_t rawtime; | |
time (&rawtime);; | |
return ctime(&rawtime); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void filterMatches(const std::vector<cv::DMatch> matches,const std::vector<cv::KeyPoint>&keypoints1,const std::vector<cv::KeyPoint>& keypoints2,std::vector<cv::DMatch>& goodMatches,double dist,double confidence_interval) | |
{ | |
goodMatches.clear(); | |
// converting keypoints to just 2D points | |
std::vector<cv::Point2f> points1, points2; | |
for (std::vector<cv::DMatch>::const_iterator it= matches.begin();it!= matches.end(); ++it) | |
{ | |
// from de matches, extract just the keypoints of the left frame | |
float x= keypoints1[it->queryIdx].pt.x; | |
float y= keypoints1[it->queryIdx].pt.y; |
NewerOlder