opencv 图像直方图匹配
程序员文章站
2022-04-01 07:56:09
...
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);
上一篇: PHP模板引擎SMARTY_php基础
下一篇: 计算两个向量的点积