Jeromer
Jeromer

Reputation: 49

How to find the amount of matches from feature extraction?

I want to be able to get the number of matches of features from two images. Unfortunately I can't seem to find how to do it. I use the most recent EMGU package that can be downloaded from NuGet I have used the code from: Feature Matching sample, but the issue is that the method they use to count the values gives an error. It gives an error at this code block:

// Calculate score based on matches size
// ---------------------------------------------->
score = 0;
for (int i = 0; i < matches.Size; i++)
{
    if (mask.GetData(i)[0] == 0) continue;
    foreach (var e in matches[i].ToArray())
        ++score;
}

Specifically at mask.GetDAta(i)[0] and it then states that int cannot be converted to bool, but I honestly don't know what to fill in as parameter then.

A different solution I have seen is use the nonzero count but that seems incorrect. Furthermore, what is mentioned here EmguCV SURF - Determine matched pairs of points does not work either.

Any help is greatly appreciated.

Upvotes: 1

Views: 195

Answers (1)

AbdelAziz AbdelLatef
AbdelAziz AbdelLatef

Reputation: 3744

I think this is a mistake in their example, try this instead:

if ((byte)mask.GetData().GetValue(i, 0) == 0) continue;

Upvotes: 1

Related Questions