Skip to content

Instantly share code, notes, and snippets.

@elijahzarlin
Created July 18, 2019 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahzarlin/0bb68eff12aadf894a591099287f4aae to your computer and use it in GitHub Desktop.
Save elijahzarlin/0bb68eff12aadf894a591099287f4aae to your computer and use it in GitHub Desktop.
let current_data = [...];//An h * w array from current step of radar image
let next_data = [...];//An h * w array from next step of radar image
let new_data = [];
for (let i = 0; i < h; i++) {
for (let j = 0; j < w; j++) {
new_data[i * w + j] = parseInt((current_data[i * w + j] + next_data[i * w + j]) / 2);
}
}
let polygons = contours()
.size([w, h])
.thresholds(smoothValues)
(new_data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment