您的位置:首页 > 运维架构

opencv 图像直方图匹配

2017-05-15 16:46 337 查看
Mat img1 = Imgcodecs.imread("/sdcard/c.jpg");
Mat img2 = Imgcodecs.imread("/sdcard/d.jpg");

Mat hist0 = new Mat();
Mat hist1 = new Mat();
MatOfFloat ranges = new MatOfFloat(0f, 256f);

MatOfInt histSize = new MatOfInt(25);

Imgproc.calcHist(Arrays.asList(img1), new MatOfInt(0), new Mat(), hist0, histSize, ranges);
Imgproc.calcHist(Arrays.asList(img2), new MatOfInt(0), new Mat(), hist1, histSize, ranges);

double res = Imgproc.compareHist(hist0, hist1, Imgproc.CV_COMP_CORREL);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  opencv
相关文章推荐