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
// Port of https://github.com/opencv/opencv/blob/a50a355/modules/features2d/src/blobdetector.cpp | |
// But with special `faster` option which has slightly different semantics, | |
// but is a whole bunch faster. | |
function diff(v1, v2) { | |
if (v1.x !== undefined) return { x: v1.x - v2.x, y: v1.y - v2.y }; | |
return v1.map((value, index) => value - v2[index]); | |
} | |
function norm(vector) { |