Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created October 12, 2012 19:01
Show Gist options
  • Save eduardolundgren/3880863 to your computer and use it in GitHub Desktop.
Save eduardolundgren/3880863 to your computer and use it in GitHub Desktop.
HAAR convertor analysis
[
// s1
{
t: [
{
rect: [
3, 7, 14, 4, -1,
3, 9, 14, 2, 2
],
t: 4.0141958743333817e-003,
l: 0.0337941907346249,
r: 0.8378106951713562
}
],
th: 0.8226894140243530,
i: -1
},
// s2
[
-1,
0.8226894140243530,
[
[
3, 7, 14, 4, -1,
3, 9, 14, 2, 2,
4.0141958743333817e-003,
0.0337941907346249,
0.8378106951713562
],
[
3, 7, 14, 4, -1,
3, 9, 14, 2, 2,
4.0141958743333817e-003,
0.0337941907346249,
0.8378106951713562
]
]
]
];
// Using s1
var stages;
var i = stages.i,
thg = stages.th,
nodes = stages.t;
for (;;) {
var node = nodes[i],
rect = node.rect,
x1 = rect[0],
y1 rect[1],
w1 = rect[2],
h1 = rect[3],
p1 = rect[4],
x2 = rect[5],
y2 rect[6],
w2 = rect[7],
h2 = rect[8],
p2 = rect[9],
t = node.t,
l = node.l,
r = node.r;
}
// Using s2
var stages;
var i = stages[0],
thg = stages[1],
nodes = stages[2];
for (;;) {
var node = nodes[i],
x1 = node[0],
y1 node[1],
w1 = node[2],
h1 = node[3],
p1 = node[4],
x2 = node[5],
y2 node[6],
w2 = node[7],
h2 = node[8],
p2 = node[9],
t = node[10],
l = node[11],
r = node[12];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment