使用方法
!function($) {
function get_named_arguments(params, names) {
if (params.length > 1) {
for (var new_params = {}, i = 0; i < names.length; i++) new_params[names[i]] = params[i];
return new_params;
}
return 1 == params.length ? params[0] : {};
}
var cascade = {
count: 16,
width: 24,
height: 24,
stage_classifier: [ {
count: 4,
threshold: -4.57753,
feature: [ {
size: 4,
px: [ 3, 5, 8, 11 ],
py: [ 2, 2, 6, 3 ],
pz: [ 2, 1, 1, 0 ],
nx: [ 8, 4, 0, 0 ],
ny: [ 4, 4, 0, 0 ],
nz: [ 1, 1, -1, -1 ]
}, {
size: 3,
px: [ 3, 6, 7 ],
py: [ 7, 13, 0 ],
pz: [ 1, 0, -1 ],
nx: [ 2, 3, 4 ],
ny: [ 5, 4, 4 ],
nz: [ 2, 1, 1 ]
}, {
size: 5,
px: [ 5, 3, 10, 13, 11 ],
py: [ 1, 0, 3, 2, 2 ],
pz: [ 1, 2, 0, 0, 0 ],
nx: [ 0, 11, 0, 11, 11 ],
ny: [ 0, 2, 3, 1, 1 ],
nz: [ 1, 1, 0, 1, -1 ]
}, {
size: 5,
px: [ 6, 12, 12, 9, 12 ],
py: [ 4, 13, 12, 7, 11 ],
pz: [ 1, 0, 0, 1, 0 ],
nx: [ 8, 0, 8, 2, 11 ],
ny: [ 4, 0, 8, 5, 1 ],
nz: [ 1, -1, -1, -1, -1 ]
} ],
alpha: [ -2.879683, 2.879683, -1.569341, 1.569341, -1.286131, 1.286131, -1.157626, 1.157626 ]
}, {
count: 4,
threshold: -4.339908,
feature: [ {
size: 5,
px: [ 13, 12, 3, 11, 17 ],
py: [ 3, 3, 1, 4, 13 ],
pz: [ 0, 0, 2, 0, 0 ],
nx: [ 4, 3, 8, 15, 15 ],
ny: [ 4, 5, 4, 8, 8 ],
nz: [ 1, 2, 1, 0, -1 ]
}, {
size: 5,
px: [ 6, 7, 6, 3, 3 ],
py: [ 13, 13, 4, 2, 7 ],
pz: [ 0, 0, 1, 2, 1 ],
nx: [ 4, 8, 3, 0, 15 ],
ny: [ 4, 4, 4, 3, 8 ],
nz: [ 1, 1, -1, -1, -1 ]
}, {
size: 3,
px: [ 2, 2, 11 ],
py: [ 3, 2, 5 ],
pz: [ 2, 2, 0 ],
nx: [ 3, 8, 3 ],
ny: [ 4, 4, 4 ],
nz: [ 1, -1, -1 ]
}, {
size: 5,
px: [ 15, 13, 9, 11, 7 ],
py: [ 2, 1, 2, 1, 0 ],
pz: [ 0, 0, 0, 0, 1 ],
nx: [ 23, 11, 23, 22, 23 ],
ny: [ 1, 0, 2, 0, 0 ],
nz: [ 0, 1, 0, 0, 0 ]
} ],
alpha: [ -2.466029, 2.466029, -1.83951, 1.83951, -1.060559, 1.060559, -1.094927, 1.094927 ]
}, {
count: 7,
threshold: -5.052474,
feature: [ {
size: 5,
px: [ 17, 13, 3, 11, 10 ],
py: [ 13, 2, 1, 4, 3 ],
pz: [ 0, 0, 2, 0, 0 ],
nx: [ 4, 8, 8, 3, 7 ],
ny: [ 2, 8, 4, 5, 4 ],
nz: [ 2, 0, 1, 2, 1 ]
}, {
size: 5,
px: [ 6, 7, 3, 6, 6 ],
py: [ 4, 12, 2, 13, 14 ],
pz: [ 1, 0, 2, 0, 0 ],
nx: [ 8, 3, 4, 4, 3 ],
ny: [ 4, 4, 2, 0, 2 ],
nz: [ 1, 1, -1, -1, -1 ]
}, {
size: 5,
px: [ 7, 4, 5, 3, 3 ],
py: [ 2, 1, 3, 1, 1 ],
pz: [ 0, 1, 0, 1, -1 ],
nx: [ 1, 0, 1, 1, 0 ],
ny: [ 1, 3, 2, 0, 4 ],
nz: [ 0, 0, 0, 0, 0 ]
}, {
size: 5,
px: [ 11, 11, 11, 3, 2 ],
py: [ 11, 13, 10, 7, 2 ],
pz: [ 0, 0, 0, 1, 2 ],
nx: [ 4, 1, 8, 2, 0 ],
ny: [ 4, 1, 12, 0, 4 ],
nz: [ 1, -1, -1, -1, -1 ]
}, {
size: 3,
px: [ 9, 13, 1 ],
py: [ 7, 19, 4 ],
pz: [ 1, -1, -1 ],
nx: [ 4, 7, 4 ],
ny: [ 5, 8, 2 ],
nz: [ 2, 1, 2 ]
}, {
size: 5,
px: [ 12, 8, 16, 4, 4 ],
py: [ 12, 1, 2, 0, 0 ],
pz: [ 0, 1, 0, 2, -1 ],
nx: [ 11, 22, 11, 23, 23 ],
ny: [ 2, 0, 1, 1, 5 ],
nz: [ 1, 0, 1, 0, 0 ]
}, {
size: 3,
px: [ 11, 17, 17 ],
py: [ 6, 11, 12 ],
pz: [ 0, 0, 0 ],
nx: [ 15, 1, 11 ],
ny: [ 9, 1, 1 ],
nz: [ 0, -1, -1 ]
} ],
alpha: [ -2.15689, 2.15689, -1.718246, 1.718246, -.9651329, .9651329, -.994809, .994809, -.8802466, .8802466, -.8486741, .8486741, -.8141777, .8141777 ]
}, {
count: 13,
threshold: -5.7744,
feature: [ {
size: 5,
px: [ 6, 10, 3, 12, 14 ],
py: [ 5, 3, 1, 2, 2 ],
pz: [ 1, 0, 2, 0, 0 ],
nx: [ 3, 4, 14, 8, 4 ],
ny: [ 5, 4, 8, 4, 2 ],
nz: [ 2, 1, 0, 1, 2 ]
}, {
size: 5,
px: [ 10, 6, 11, 5, 12 ],
py: [ 4, 13, 4, 2, 4 ],
pz: [ 0, 0, 0, 1, 0 ],
nx: [ 1, 4, 8, 1, 1 ],
ny: [ 2, 4, 4, 4, 3 ],
nz: [ 0, 1, 1, 0, 0 ]
}, {
size: 3,
px: [ 18, 6, 12 ],
py: [ 12, 4, 8 ],
pz: [ 0, 1, 0 ],
nx: [ 7, 4, 8 ],
ny: [ 4, 2, 4 ],
nz: [ 1, -1, -1 ]
}, {
size: 5,
px: [ 7, 5, 6, 3, 17 ],
py: [ 13, 12, 3, 8, 13 ],
pz: [ 0, 0, 1, 1, 0 ],
nx: [ 3, 3, 0, 1, 8 ],
ny: [ 4, 5, 5, 10, 4 ],
nz: [ 1, -1, -1, -1, -1 ]
}, {
size: 5,
px: [ 16, 7, 16, 7, 7 ],
py: [ 1, 1, 2, 0, 0 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[ 4, 16, 7, 7, 23 ],
pz: [ 2, 0, 1, 1, 0 ],
nx: [ 0, 1, 1, 1, 1 ],
ny: [ 10, 21, 23, 22, 22 ],
nz: [ 1, 0, 0, 0, -1 ]
} ],
alpha: [ -1.956565, 1.956565, -1.262438, 1.262438, -1.056941, 1.056941, -.9712509, .9712509, -.8261028, .8261028, -.8456506, .8456506, -.6652113, .6652113, -.6026287, .6026287, -.6915425, .6915425, -.5539286, .5539286, -.5515072, .5515072, -.6685884, .6685884, -.465607, .465607 ]
}, {
count: 20,
threshold: -5.606853,
feature: [ {
size: 5,
px: [ 17, 11, 6, 14, 9 ],
py: [ 13, 4, 4, 3, 3 ],
pz: [ 0, 0, 1, 0, 0 ],
nx: [ 14, 4, 8, 7, 8 ],
ny: [ 8, 4, 4, 4, 8 ],
nz: [ 0, 1, 1, 1, 0 ]
}, {
size: 5,
px: [ 3, 9, 10, 11, 11 ],
py: [ 7, 2, 2, 3, 3 ],
pz: [ 1, 0, 0, 0, -1 ],
nx: [ 3, 8, 4, 2, 5 ],
ny: [ 4, 4, 10, 2, 8 ],
nz: [ 1, 1, 1, 2, 1 ]
}, {
size: 5,
px: [ 12, 12, 12, 5, 12 ],
py: [ 12, 9, 10, 12, 11 ],
pz: [ 0, 0, 0, 0, 0 ],
nx: [ 0, 0, 0, 0, 0 ],
ny: [ 2, 1, 3, 0, 0 ],
nz: [ 0, 0, 0, 0, -1 ]
}, {
size: 5,