You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.0 KiB
52 lines
1.0 KiB
#ifndef LANE_COMPARE_HPP
|
|
#define LANE_COMPARE_HPP
|
|
|
|
#include "spline.hpp"
|
|
#include <vector>
|
|
#include <iostream>
|
|
#include <opencv2/core/version.hpp>
|
|
#include <opencv2/core/core.hpp>
|
|
|
|
#if CV_VERSION_EPOCH == 2
|
|
#define OPENCV2
|
|
#elif CV_VERSION_MAJOR == 3
|
|
#define OPENCV3
|
|
#else
|
|
#error Not support this OpenCV version
|
|
#endif
|
|
|
|
#ifdef OPENCV3
|
|
#include <opencv2/imgproc.hpp>
|
|
#elif defined(OPENCV2)
|
|
#include <opencv2/imgproc/imgproc.hpp>
|
|
#endif
|
|
|
|
using namespace std;
|
|
using namespace cv;
|
|
|
|
class LaneCompare{
|
|
public:
|
|
enum CompareMode{
|
|
IOU,
|
|
Caltech
|
|
};
|
|
|
|
LaneCompare(int _im_width, int _im_height, int _lane_width = 10, CompareMode _compare_mode = IOU){
|
|
im_width = _im_width;
|
|
im_height = _im_height;
|
|
compare_mode = _compare_mode;
|
|
lane_width = _lane_width;
|
|
}
|
|
|
|
double get_lane_similarity(const vector<Point2f> &lane1, const vector<Point2f> &lane2);
|
|
void resize_lane(vector<Point2f> &curr_lane, int curr_width, int curr_height);
|
|
private:
|
|
CompareMode compare_mode;
|
|
int im_width;
|
|
int im_height;
|
|
int lane_width;
|
|
Spline splineSolver;
|
|
};
|
|
|
|
#endif
|