openCV:创建一个特征匹配,输出数组的意思,java

以下代码(使用用于图像处理的 openCV -libraries以Java编写)生成类MatOfDMatch的输出。 问题是我不明白数组中的值告诉我匹配的内容:

FeatureDetector fastFeatureDetector = FeatureDetector .create(FeatureDetector.FAST); DescriptorExtractor surfDescriptorExtractor = DescriptorExtractor .create(DescriptorExtractor.SURF); DescriptorMatcher flannDescriptorMatcher = DescriptorMatcher .create(DescriptorMatcher.FLANNBASED); Mat image1 = Highgui.imread(myPicPath); Mat image2 = Highgui.imread(myPicPath2); ArrayList keypoints1 = new ArrayList(); keypoints1.add(new MatOfKeyPoint()); ArrayList keypoints2 = new ArrayList(); keypoints2.add(new MatOfKeyPoint()); fastFeatureDetector.detect(image1, keypoints1.get(0)); fastFeatureDetector.detect(image2, keypoints2.get(0)); Mat descriptor1 = new Mat(); Mat descriptor2 = new Mat(); surfDescriptorExtractor.compute(image1, keypoints1.get(0), descriptor1); surfDescriptorExtractor.compute(image2, keypoints2.get(0), descriptor2); ArrayList matches = new ArrayList(); matches.add(new MatOfDMatch()); flannDescriptorMatcher.match(descriptor1, descriptor2, matches.get(0)); Mat outImg = new Mat(); Features2d.drawMatches(image1, keypoints1.get(0), image2, keypoints2.get(0), matches.get(0), outImg, new Scalar(0, 255, 0), new Scalar(0, 0, 255), new MatOfByte(), Features2d.NOT_DRAW_SINGLE_POINTS); Highgui.imwrite(myOutpuPicPath, outImg); //The following code part is not part of the Matching process (which is above part), //I include it here because it prints the MatOfDMatchvalues in a readable fashion ArrayList matchChannel_0 = new ArrayList(); ArrayList matchChannel_1 = new ArrayList(); ArrayList matchChannel_2 = new ArrayList(); ArrayList matchChannel_3 = new ArrayList(); for (int j = 0; j < matches.get(0).size().height; j++) { matchChannel_0.add(matches.get(0).get(j, 0)[0]); matchChannel_1.add(matches.get(0).get(j, 0)[1]); matchChannel_2.add(matches.get(0).get(j, 0)[2]); matchChannel_3.add(matches.get(0).get(j, 0)[3]); } System.out.println(matchChannel_0 + "\n" + matchChannel_1 + "\n" + matchChannel_2 + "\n" + matchChannel_3); 

image1image2设置为相同的pic ,使matchChannel_1所有值变为matchChannel_0并且值matchChannel_3变为全0。

image1image2设置为不同的图片 ,值会变得不同。

这些数值意味着什么? 他们肯定要讲述一些关于比赛的事情 ,但我无法弄清楚到底是什么以及如何。 我需要一个答案,例如“在该渠道中更大的价值意味着这个,而在另一个渠道中”。 有人可以澄清一下,因为本页面的openCV教程没有解释。