From 18ff32ba07b886bce1699535e9dc757ba3622338 Mon Sep 17 00:00:00 2001 From: Jack Yu <455501914@qq.com> Date: Tue, 1 May 2018 20:28:25 +0800 Subject: [PATCH] Update util.h --- Prj-Linux/lpr/src/util.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Prj-Linux/lpr/src/util.h b/Prj-Linux/lpr/src/util.h index 76a452f..3f9f52c 100644 --- a/Prj-Linux/lpr/src/util.h +++ b/Prj-Linux/lpr/src/util.h @@ -1,20 +1,16 @@ // -// Created by 庾金科 on 04/04/2017. +// Created by Jack Yu on 04/04/2017. // #include - namespace util{ - template void swap ( T& a, T& b ) { T c(a); a=b; b=c; } - template T min(T& a,T& b ) { return a>b?b:a; - } cv::Mat cropFromImage(const cv::Mat &image,cv::Rect rect){ @@ -57,23 +53,15 @@ namespace util{ int histSize = 256; float range[] = {0,255}; const float* histRange = {range}; - cv::calcHist( &hsv_planes[0], 1, 0, cv::Mat(), hist, 1, &histSize, &histRange,true, true); return hist; - } + float computeSimilir(const cv::Mat &A,const cv::Mat &B) { - cv::Mat histA,histB; histA = calcHist(A); histB = calcHist(B); return cv::compareHist(histA,histB,CV_COMP_CORREL); - } - - - - - }//namespace util