thinnedYM.copy(thinningYM.array());
if (!only4Direction) {
thinnedXPYP.copy(thinningXPYP.array());
thinnedXMYP.copy(thinningXMYP.array());
thinnedXMYM.copy(thinningXMYM.array());
thinnedXPYM.copy(thinningXPYM.array());
}
int b1, b2, b3, b4;
b1 = thinnedXP.getBit(2 * 8 + 2) ? 1 : 0;
b2 = thinnedYP.getBit(2 * 8 + 2) ? 1 : 0;
b3 = thinnedXM.getBit(2 * 8 + 2) ? 1 : 0;