1 | initial version |
i don't think, you need the geneal solution above, we can simply exploit, that there are max. 2 times 180 in 360, then it's:
Mat mask = angle > 180.0f; subtract(angle, 180.0f, angle, mask);
or , in one line:
subtract(angle, 180.0f, angle, (angle>180.0f));
2 | No.2 Revision |
i don't think, you need the geneal general solution above, we can simply exploit, that there are max. 2 times 180 in 360, then it's:
Mat mask = angle > 180.0f;
subtract(angle, 180.0f, angle, or , in one line:
subtract(angle, 180.0f, angle, 3 | No.3 Revision |
i don't think, you need the general solution above, we can simply exploit, that there are max. 2 times 180 in 360, then it's:
Mat mask = angle > 180.0f;
subtract(angle, 180.0f, angle, mask);
or , in one line:
subtract(angle, 180.0f, angle, (angle>180.0f));
you can even run wild with c++11 here:
angle.forEach([&](float &f, const int *p) {f = fmod(f,180.0f);});