Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is how I did it:

        byte[] raw_data = ...;
        Mat mat = new Mat();
        mat.put(0, 0, raw_data);

This is how I did it:it: byte[] to Mat:

        byte[] raw_data = ...;
        Mat mat = new Mat();
        mat.put(0, 0, raw_data);

Mat to byte[]:

        byte[] return_buff = new byte[(int) (result_mat.total() * 
                                            result_mat.channels())];
        result_mat.get(0, 0, return_buff);