Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat to matOfByte conversion in java

Can someone explain what this code is doing.I mean how big is byteArray If I have Mat dimension (h= 300, w = 400)?

    MatOfByte matOfByte = new MatOfByte();

    Highgui.imencode(".jpg", image_tmp, matOfByte); 

    byte[] byteArray = matOfByte.toArray();
click to hide/show revision 2
retagged

updated 2013-10-06 01:55:06 -0600

berak gravatar image

Mat to matOfByte conversion in java

Can someone explain what this code is doing.I mean how big is byteArray If I have Mat dimension (h= 300, w = 400)?

    MatOfByte matOfByte = new MatOfByte();

    Highgui.imencode(".jpg", image_tmp, matOfByte); 

    byte[] byteArray = matOfByte.toArray();