Created
March 19, 2020 16:33
-
-
Save albjeremias/c50a5610d35e40f279546f8ee1d1d4ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OpencvExt() { | |
cv.DMatchVector.prototype.sort = function () { | |
for (let i = 0; i < this.size(); i++) { | |
for (let j = 0; j < this.size(); j++) { | |
if (this.get(i).distance < this.get(j).distance) { | |
let x = this.get(i); | |
let y = this.get(j); | |
this.set(i, y); | |
this.set(j, x); | |
} | |
} | |
} | |
} | |
cv.DMatchVector.prototype.resizeMe=function(length){ | |
let matchesResized = new cv.DMatchVector(); | |
for (let i = 0; i < length; i++) { | |
matchesResized.push_back(this.get(i)); | |
} | |
return matchesResized; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment