android - Print opencv matrix content in Java -
i have opencv matrix in java , print out content of it.i tried tostring() function follows descriptor.tostring() achieve form
"[[1,2,3,4],[4,5,6,7],[7,8,9,10]]"
where each array ith row in matrix got following result. tried remove tostring still same problem.
mat [ 3*4*cv_8uc1, iscont=true, issubmat=false, nativeobj=0x5dc93a48, dataaddr=0x5d5d35f0]
where 3 number of rows , 4 number of columns.
any how can matrix content?!
code:
int[][] testarray = new int[][]{{1,2,3,4},{4,5,6,7},{7,8,9,10}}; mat matarray = new mat(3,4,cvtype.cv_8uc1); for(int row=0;row<3;row++){ for(int col=0;col<4;col++) matarray.put(row, col, testarray[row][col]); } system.out.println("printing matrix dump"); system.out.println(matarray.dump());
output:
printing matrix dump
[1, 2, 3, 4;
4, 5, 6, 7;
7, 8, 9, 10]
Comments
Post a Comment