I am new in Emgu CV . I need a matrix array to store pixel values of gray images. Is it possible to declare a matrix array .
I code like this for matrix array But is gives "Error"
public Matrix<Double>[] Myimgmatrix = new Matrix<Double>[5](100,80);
Error:"Method name expected"
Any one Please Help.
Do it like that:
private Matrix<Double>[] Myimgmatrix = new Matrix<Double>[5];
And then, on your class constructor, initialize every matrix on the array individually:
for(int i = 0; i < Myimgmatrix.Length; i++)
Myimgmatrix[i] = new Matrix<Double>(100,80);
As far as I know, you can't instantiate the array and its elements at the same time.
You can also create a matrix list, if you don't want to be flexible with the size of your array:
private List<Matrix<Double>> matrixList = new List<Matrix<Double>>();
and then, when you need a new matrix, just add it to your list, on the code:
matrixList.Add(new Matrix<Double>(100,80));
Actually you can directly access gray pixel values from the image data in emgucv. You can check the implementation in emgu cv from this link work with matrix