You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to populate a matrix myself, for example have a matrix 3x3:
1 3 5
2 4 6
7 8 9
But I couldn't find a way to do it, in C++ we can use mat.at(0,0) = 1 for example, to change a value in the matrix.
Is it already possible to do it and I'm missing something or is it something not implemented?
Ideally doing something like:
var mat = new cv.Mat(3, 3, type, [1,3,5,2,4,6,7,8,9])
or
mat.at(i,j,value)
Also my goal was then to use cv::calibrateCamera, cv::solvePnP and cv::Rodrigues which are not implemented yet. So once I understand how to populate a matrix I can try to implement myself those new functions unless you can do it fast (I've already spent 1 and a half days trying to do it unsuccessfully...)
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Mat::at() should work in Javascript as well. Are you getting an error ?
I have not worked on this in a long time and I cannot dedicate much time to it now, as there hasn't been too much interest in the project from the public at large.
But I can try and guide you on how to implement more extensions - it's fairly easy. I have used a generator to generate most of the functions, but I think it's ok to just implement them manually from now on, as there's not so much work to do.
To implement the constructor you want, check out opencvjs.cpp and look at how other constructors for cv.Mat work (JMat::__constructor methods), then you can write your own in a similar fashion.
Hello,
I've tried to populate a matrix myself, for example have a matrix 3x3:
1 3 5
2 4 6
7 8 9
But I couldn't find a way to do it, in C++ we can use mat.at(0,0) = 1 for example, to change a value in the matrix.
Is it already possible to do it and I'm missing something or is it something not implemented?
Ideally doing something like:
var mat = new cv.Mat(3, 3, type, [1,3,5,2,4,6,7,8,9])
or
mat.at(i,j,value)
Also my goal was then to use cv::calibrateCamera, cv::solvePnP and cv::Rodrigues which are not implemented yet. So once I understand how to populate a matrix I can try to implement myself those new functions unless you can do it fast (I've already spent 1 and a half days trying to do it unsuccessfully...)
Thanks in advance.
The text was updated successfully, but these errors were encountered: