//utils.h
#ifndef _UTILS_H
#define _UTILS_H
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2\nonfree\nonfree.hpp>
using namespace cv;
// ORB settings
const int ORB_MAX_KPTS = 1500;
const float ORB_SCALE_FACTOR = 1.5;
const int ORB_PYRAMID_LEVELS = 3;
const float ORB_EDGE_THRESHOLD = 31.0;
const int ORB_FIRST_PYRAMID_LEVEL = 0;
const int ORB_WTA_K = 2;
const int ORB_PATCH_SIZE = 31;
// BRISK settings
const float BRISK_HTHRES = 10.0;
const int BRISK_NOCTAVES = 6;
const float DRATIO = 0.8f; // NNDR Matching value
const float MIN_H_ERROR = 2.50f; // Maximum error in pixels to accept an inlier
void matches2points_nndr(const std::vector<cv::KeyPoint>& train,
const std::vector<cv::KeyPoint>& query,
const std::vector<std::vector<cv::DMatch> >& matches,
std::vector<cv::Point2f>& pmatches, float nndr);
void compute_inliers_ransac(const std::vector<cv::Point2f>& matches,
std::vector<cv::Point2f>& inliers,
float error, bool use_fund);
void draw_inliers(const cv::Mat& img1, const cv::Mat& img2, cv::Mat& img_com,
const std::vector<cv::Point2f>& ptpairs, int color);
typedef struct info
{
double t;
int n1;
int n2;
int m;
int rm;
}INFO;
void sift(char* path1, char* path2, INFO& info, bool show);
void surf(char* path1, char* path2, INFO& info, bool show);
void orb(char* path1, char* path2, INFO& info, bool show);
void brisk(char* path1, char* path2, INFO& info, bool show);
void freak(char* path1, char* path2, INFO& info, bool show);
void showInfo(INFO info);
#endif
//utils.