I wrote a code that finds the closest matches to K using the KNN algorithm. Having received matMatch and matchIndices, I tried to draw pairs of matches between two frames of consequences.
I pass matMask and matchIndices to the Features2DToolbox.DrawMatches function:
Image<Bgr, byte> imResult = Features2DToolbox.DrawMatches(imModelCurr, imModel.keyPoints, imObserPrev,imObser.keyPoints, **matchIndices**, new Bgr(System.Drawing.Color.Yellow), new Bgr(System.Drawing.Color.Red), **matMask**, Features2DToolbox.KeypointDrawType.NOT_DRAW_SINGLE_POINTS);
http://www.emgu.com/wiki/files/2.4.0/document/html/e92d37e6-fe4a-ad09-9304-cd2d2533bfa8.htm , but I noticed that it returns an invalid pattern between matching pairs:

Then I tried to implement such a function myself:
for (int i = 0; i < matMask.Rows; ++i) { if (**matMask[i, 0]** > 0) { int indForCurrFrm = **matchIndices[i, 0]**; int indForPrevFrm = i; //for frame i-1 PointF fromFirstFrame = getImgObserved(keyPoints[indForPrevFrm]); //for frame i PointF NextCorrespondingMatchedFrame = getImModelXY(keyPoints[indForCurrFrm]); imColorPrv2.Draw(new CircleF(fromFirstFrame, 5), new Bgr(mtchColor), 3);// for frame i-1 imColorShow.Draw(new CircleF(NextCorrespondingMatchedFrame, 5), new Bgr(mtchColor), 3); // for frame i // draw line on my own matching imResult.Draw(new LineSegment2DF(fromFirstFrame,NextCorrespondingMatchedFrame),new Bgr(System.Drawing.Color.FloralWhite),1); } }
and select the corresponding coordinates of the pairs of points (X, Y) and draw them yourself (see the results in the picture).
In the lower left corner you can see the coincidences (shown by a white line) and each corresponding pair with a circle of the same color [according to my own function], and on the other hand - at the bottom right, these are the results drawn by the DrawMatches function from Emgu.Pay note that these two functions use the same matMash and matchIndices.
So, I was wondering if there are DrawMatches in EMGU with errors or am I doing something wrong?