Skip to content

Instantly share code, notes, and snippets.

@sineline
sineline / README.md
Created March 1, 2020 21:36 — forked from tmcw/README.md
Jenks Natural Breaks with simple-statistics and d3
@sineline
sineline / SimpleBlobDetector.js
Created March 1, 2020 13:47 — forked from janpaul123/SimpleBlobDetector.js
OpenCV SimpleBlobDetector port to OpenCV.js
// 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) {