+ std::vector<double> feature;
+ cv::Mat im1(PREFERRED_SIZE, p1->image_crop.type());
+ cv::Mat im2(PREFERRED_SIZE, p2->image_crop.type());
+ cv::resize(p1->image_crop, im1, im1.size());
+ cv::resize(p2->image_crop, im2, im2.size());
+ cv::Mat result;
+ cv::matchTemplate(im1, im2, result, CV_TM_CCOEFF_NORMED);
+ feature.push_back(result.at<double>(0, 0));
+ cv::matchTemplate(im1, im2, result, CV_TM_CCORR_NORMED);
+ feature.push_back(result.at<double>(0, 0));
+
+
+ vector<double>& f1_hog = p1->features.first; Mat f1_hue = p1->features.second;
+ vector<double>& f2_hog = p1->features.first; Mat f2_hue = p1->features.second;
+ feature.push_back(distance_cosine(Eigen::Map<Eigen::VectorXd>(f1_hog.data(), f1_hog.size()),
+ Eigen::Map<Eigen::VectorXd>(f2_hog.data(), f2_hog.size())));
+ feature.push_back(distance_euclidean(Eigen::Map<Eigen::VectorXd>(f1_hog.data(), f1_hog.size()),
+ Eigen::Map<Eigen::VectorXd>(f2_hog.data(), f2_hog.size())));
+ feature.push_back(compareHist(f1_hue, f2_hue, HISTCMP_CORREL));
+ feature.push_back(compareHist(f1_hue, f2_hue, HISTCMP_HELLINGER));
+
+ Detection& d1 = p1->detection;
+ Detection& d2 = p2->detection;
+
+ double center_distance = sqrt(pow((d1.center_x - d2.center_x), 2) + pow((d1.center_y - d2.center_y), 2));
+ feature.push_back(center_distance / (d1.width + d1.height + d2.width + d2.height) * 4);
+
+ feature.push_back(calc_iou_ratio(getRectInDetection(d1), getRectInDetection(d2)));
+
+ return feature;