MCPcopy
hub / github.com/ericdrowell/KineticJS / rgbMean

Function rgbMean

kinetic.js:4714–4728  ·  view source on GitHub ↗
(pTab)

Source from the content-addressed store, hash-verified

4712 }
4713
4714 function rgbMean(pTab) {
4715 var m = [0, 0, 0];
4716
4717 for (var i = 0; i < pTab.length; i++) {
4718 m[0] += pTab[i][0];
4719 m[1] += pTab[i][1];
4720 m[2] += pTab[i][2];
4721 }
4722
4723 m[0] /= pTab.length;
4724 m[1] /= pTab.length;
4725 m[2] /= pTab.length;
4726
4727 return m;
4728 }
4729
4730 function backgroundMask(idata, threshold) {
4731 var rgbv_no = pixelAt(idata, 0, 0);

Callers 1

backgroundMaskFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected