keke77 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

User allocation for Mat class #464

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, thanks for javacv.
I have one question: how can I initiate 3x3 Mat class by inserting my own float 
numbers?
I found a way in C++ but I don't understand C++...
Mat M = (Mat_<double>(3,3) << 1, 0, 0, 0, 1, 0, 0, 0, 1);

 also in JavaCV, there is a Mat class method, put (row, column, float[])
but it's always giving UnsupportedOperationException.

It's great if you could share the way to assign user defined values.
Thanks,

Hiro

Original issue reported on code.google.com by hironor...@gmail.com on 24 Apr 2014 at 7:35

GoogleCodeExporter commented 9 years ago
We can do that just as shown in the README.txt file:
    CvMat M = CvMat.create(3, 3).put(1, 0, 0, 0, 1, 0, 0, 0, 1);

And please ask your questions on the mailing list next time if possible, thank 
you.

Original comment by samuel.a...@gmail.com on 28 Apr 2014 at 10:55