Can anybody tell me what does cvmSet actually doing in the following code. Especially L0[y*5 + x]
this portion. Also, is the array declared a 1D array or 2D array? I guess it is 1D array. I just want to understand that particular line. Any help will be appreciated.
I mean if the value of array is calculated as L0[y*5 + x],so what is the role of the elements in L0, then what is the point in initializing the array elements of 1D L0?
float L0[]={
-1,-1,-1,-1,-1,
0, 0, 0, 0, 0,
2, 2, 2, 2, 2,
0, 0, 0, 0, 0,
-1,-1,-1,-1,-1 };
CvMat* rgbMat = cvCreateMat(5, 5, CV_32FC1);
for (int y = 0; y < 5; y++)
{
for (int x = 0; x < 5; x++)
cvmSet(rgbMat, y, x, L0[y*5 + x]);
}