// cvDiv() doesn't support division by zero...
FloatBuffer fb1 = float1.getFloatBuffer();
FloatBuffer fb2 = float2.getFloatBuffer();
ByteBuffer rmb = roiMask.getByteBuffer();
assert(fb1.capacity() == fb2.capacity()/3);
assert(fb1.capacity() == rmb.capacity()/3);
int[] nPixels = new int[channels];
for (int i = 0, j = 0; j < fb1.capacity(); i++, j+=channels) {
for (int z = 0; z < channels; z++) {
float ra = fb1.get(j+z);
float r = fb2.get(j+z);