Java Mat.Put Not Working?

asked 2015-03-09 10:19:05 -0600

Poyan gravatar image

I have the following snippet which successfully gets a matrix element's value(s).

However, the values I try to put back, never actually update the matrix object.

Any ideas?

        float[] floats = new float[imgDescriptor.channels()];
        imgDescriptor.get(1, trainIdx, floats);
        // Just in case, we loop through the whole array
        for (int j = 0; j < floats.length; j++) {
            floats[j] = floats[j] + 1.0f;
        }
        imgDescriptor.put(1, trainIdx, floats);
edit retag flag offensive close merge delete