bytedeco/javacv

How to use BestOf2NearestMatcher apply2()?

Open

#2 027 ouverte le 15 mai 2023

Voir sur GitHub
 (25 commentaires) (0 réactions) (0 assignés)Java (1 583 forks)batch import
enhancementhelp wantedquestion

Métriques du dépôt

Stars
 (6 985 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

This is probably a simple answer but I am new to javacv. I am translating some python to javacv and I am having issues calling the apply2 function of the BestOf2NearestMatcher. I am trying to pass a list of ImageFeatures as the first parameter but I am getting a type mismatch error. The documentation for apply2 says it accepts StdVector opencv_stitching.ImageFeatures. How can I convert my List to properly pass to the apply2 function?

Here is my function

fun matchFeatures(features: List<ImageFeatures>) : MatchesInfo {
    var matcher = BestOf2NearestMatcher.create()
    var pairwise_matches = MatchesInfo()
    matcher.apply2(features, pairwise_matches)
    return pairwise_matches
}

Guide contributeur