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; |
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
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 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
//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
#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
vector<string> readFile(string filename) | |
{ | |
ifstream in(filename); | |
vector<string> res; | |
string line; | |
while (std::getline(infile,line)) | |
{ | |
res.push_back(line); | |
} |
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
vec4 plane3points(vec3 u,vec3 v,vec3 w) | |
{ | |
//the function returns a 4-vector with the plane equation coefficients | |
//assuming the form ax + by + cz + d = 0 | |
vec4 res; | |
vec3 p1,p2,n; | |
vec d; | |
p1 = normalise(v - u); | |
p2 = normalise(w - u); | |
n = normalise(cross(p1,p2)); |
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 <iostream> | |
#include <armadillo> | |
#include <fstream> | |
#include <string> | |
#include <vector> | |
#include <math.h> | |
#include <iomanip> | |
using namespace std; |
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 <iostream> | |
#include <fstream> | |
#include <string> | |
#include <cstdlib> | |
#include <windows.h> | |
#include <sstream> | |
#include <stdio.h> | |
#include<time.h> | |
#include<ctime> |
OlderNewer