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; } }