not displeased–as devs we feel around in the dark quite a bit… I’ve read and poked at the alternatives. Opencv.js would be the most powerful javascript library for this sort of thing out there if more people used it but I think most try, are disappointed and move on… but you are correct that the lack of docs makes it difficult. what makes it more difficult though is the lack of experience with the javascript library and that takes time and effort. I’ve also filed a bug in the past on opencv.js and it’s not moved other than being checked in so I was thinking there was no one working on the code at this time.
in regards to your point about the array, I thought the same thing and also tried this:
let points1 = [];
let points2 = [];
for (let i = 0; i < good_matches.size(); i++) {
points1.push(keypoints1.get(good_matches.get(i).queryIdx ).pt );
points2.push(keypoints2.get(good_matches.get(i).trainIdx ).pt );
and it creates this:
[0 … 99]
0:
x: 371.2216796875
y: 258.982177734375
__proto__: Object
1: {x: 348.1711730957031, y: 262.8340759277344}
2: {x: 376.22442626953125, y: 266.4711608886719}
3: {x: 300.205810546875, y: 274.12786865234375}
but gives same result. I uploaded that just now in case you were interested.
also, your comments about “good” matches requires Lowe’s ratio test, which requires flann and the two nearest matches for every query. what you have is just the nearest/best match and from that you can’t judge the quality of a match.
I was following this code OpenCV: Feature Matching with FLANN and here is how i’m doing it. but DMatchVectorVector() doesn’t seem to takes any arguments like cv.FLANNBASED as outlined in the example code.
let bf = new cv.BFMatcher();
let matches = new cv.DMatchVectorVector();
bf.knnMatch(descriptors1, descriptors2, matches, 2);
let counter = 0;
for (let i = 0; i < matches.size(); ++i) {
let match = matches.get(i);
let dMatch1 = match.get(0);
let dMatch2 = match.get(1);
if (dMatch1.distance <= dMatch2.distance * parseFloat(knnDistance_option)) {
good_matches.push_back(dMatch1);
counter++;
}
}
where is the opencv.js code? is this it? opencv/modules/js/src at master · opencv/opencv · GitHub I wasn’t finding functions in there that I’m using like drawMatches() so I didn’t think I was in the right place…