Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

OpenCV mat to float bytebuffer java

//but first : check !
if (mat.depth() == CvType.CV_8U) { //bytes !
    byte[] buffer = new byte[mat.total() * mat.channels()]; 
    mat.get(0,0,buffer);
} else 
if (mat.depth() == CvType.CV_32F) { //float !
    float[] buffer = new float[mat.total() * mat.channels()]; 
    ... etc
Source by answers.opencv.org #
 
PREVIOUS NEXT
Tagged: #OpenCV #mat #float #bytebuffer #java
ADD COMMENT
Topic
Name
2+2 =