what MatOfMatch object is needed for?

asked 2015-03-27 08:25:02 -0600

RB gravatar image

updated 2015-03-27 09:38:46 -0600

berak gravatar image

I wrote the below code to get a the feeling about the feature detection. but what i could not understand is, why do we need MatOfMatch object, what it is needed for?

Code

public static void main(String[] args) {
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

    Mat img_0 = Highgui.imread(PATH_0);
    Mat img_0_rev = Highgui.imread(PATH_1);
    Mat img_output = new Mat();

    FeatureDetector fDetect = FeatureDetector.create(FeatureDetector.SIFT);

    MatOfKeyPoint mKeyPoints_0 = new MatOfKeyPoint();
    fDetect.detect(img_0, mKeyPoints_0);
    System.out.println("mKeyPoint_0: " + mKeyPoints_0.size());

    MatOfKeyPoint mKeyPoints_1 = new MatOfKeyPoint();
    fDetect.detect(img_0_rev, mKeyPoints_1);
    System.out.println("mKeyPoint_1: " + mKeyPoints_1.size());

    MatOfDMatch mDMatch = new MatOfDMatch();

    //Features2d.drawKeypoints(mKeyPoints_0, mKeyPoints_0, outImage, Scalar color, Features2d.DRAW_RICH_KEYPOINTS);
    Features2d.drawMatches(img_0, mKeyPoints_0, img_0_rev, mKeyPoints_1, mDMatch, img_output);
edit retag flag offensive close merge delete