24,854
社区成员
发帖
与我相关
我的任务
分享
double DetectAndPick::compareResult(gpu::GpuMat & src1,gpu::GpuMat & src2)
{
gpu::GpuMat hist1;
gpu::GpuMat hist2;
Mat temp1,temp2;
src1.download(temp1);
imshow("src1",temp1);
waitKey(30);
src2.download(temp2);
imshow("src2",temp2);
waitKey(30);
gpu::calcHist(src1,hist1);
Mat temp3,temp4;
hist1.download(temp3);
imshow("hist1",temp3);
waitKey(30);
gpu::calcHist(src2,hist2);
hist2.download(temp4);
imshow("hist2",temp4);
waitKey(30);
gpu::normalize(hist1,hist1,0,1,NORM_MINMAX,-1);
gpu::normalize(hist2,hist2,0,1,NORM_MINMAX,-1);
double result = compareHist(hist1,hist2,CV_COMP_BHATTACHARYYA);
return result;
}