Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Comparing 2 LBPs

$
0
0
I am using code from [bytefish.de](https://github.com/bytefish/opencv/tree/master/lbp) to generate my LBPs. If I generate 2 LBPs and their corresponding histograms, what is the best way to compare them? This is my code so far: #include "lbp.hpp" #include "histogram.hpp" #include #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace cv; int main() { //template image Mat temp = imread("Template.jpg",1); //image to be compared to Mat match = imread("Match.jpg",1); Mat dst,dst2; // image after preprocessing Mat lbp,lbp2; // lbp image Mat hist,hist2; //Convert to gray cvtColor(temp, dst, 6); cvtColor(match, dst2, 6); //remove noise GaussianBlur(dst, dst, Size(5,5), 5, 3, BORDER_CONSTANT); GaussianBlur(dst2, dst2, Size(5,5), 5, 3, BORDER_CONSTANT); //gets the lbp lbp::ELBP(dst,lbp,1,8); lbp::ELBP(dst2,lbp2,1,8); // normalize(lbp2, lbp2, 0, 255, NORM_MINMAX, CV_8UC1); //normalize(lbp, lbp, 0, 255, NORM_MINMAX, CV_8UC1); //get histograms lbp::histogram(lbp,hist,255); lbp::histogram(lbp2,hist2,255); //comparing the 2 LBP histograms double compareHist = cv::norm(hist-hist2); cout<

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>