computing LBP feature on integral image with neon

172 views Asked by At

01--02--03--04
| v1 | v2 | v3 |
05--06--07--08
| v4 | cen | v5 |
09--10--11--12
| v6 | v7 | v8 |
13--14--15--16

The algorithm like as following:

p01 = ptr[0];
p02 = ptr[w1];
p03 = ptr[w1*2];
p04 = ptr[w1*3];

ptr +=  pitch;
p05 = ptr[0];
p06 = ptr[w1];
p07 = ptr[w1*2];
p08 = ptr[w1*3];

ptr +=  pitch;
p09 = ptr[0];
p10 = ptr[w1];
p11 = ptr[w1*2];
p12 = ptr[w1*3];

ptr +=  pitch;
p13 = ptr[0];
p14 = ptr[w1];
p15 = ptr[w1*2];
p16 = ptr[w1*3];

v1 = p06+p01-p02-p05;
v2 = p07+p02-p03-p06;
v3 = p08+p03-p04-p07;
v4 = p10+p05-p06-p09;
cent = p11+p06-p07-p10;
v5 = p12+p07-p08-p11;
v6 = p14+p09-p10-p13;
v7 = p15+p10-p11-p14;
v8 = p16+p11-p12-p15;

respond = 0
if (v1>cent) respond = respond+1;
if (v2>cent) respond = respond+2;
if (v3>cent) respond = respond+4;
if (v4>cent) respond = respond+8;
if (v5>cent) respond = respond+16;
if (v6>cent) respond = respond+32;
if (v7>cent) respond = respond+64;
if (v8>cent) respond = respond+128;

ps: w1 is fixed in each function call, and ptr is unsigned int

And how to efficient do it with neon.

0

There are 0 answers