Registered Member
|
I'm trying to define a dynamic matrix like this:
A far as I understood this defines a 2D dynamic matrix of unsigned short data type elements. Later on, during the execution of my code I get the matrix size I need and store those values, for example, in two variables:
Now as I have the size of matrix dimensions I want to initialize my matrix accordingly. How to do it? What is the best way to do it? So far I'm thinking of using
however, I'm not sure if it is the right way to do it. Any thoughts? |
Moderator
|
Yes, this is the right way, but notice that the values of the coefficients are not initialized. You can then call
pixelData.setZero(); to initialize them to 0 if needed. |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft