Hi,
I have to translate this line from Matlab to C/C++:
x = (-cols/2 : (cols/2 - 1))/(cols/2);y = -(-rows/2 : (rows/2 - 1))/(rows/2);[x,y] = meshgrid(x,y);
I try to explain better.
x is a monodimensional array of lenght=cols.
y x is a monodimensional array of lenght=rows.
Cols and rows depends from the picture I charge in the project. (EX cols=696,rows=534).
x[cols]= all the elements from -(cols/2)/(cols/2) to (cols/2)-1/(cols/2)
(example) -> x[0] = -(696/2)/(696/2)= -1;
x[1]= -(695/2)/(696/2)= .-0,99
....
x[695]= 0,99
For y it s the same. After done this I have to meshgrid. I mean:
transform the domain specified by vectors x and y into arrays X and Y , that are bidimensional arrays.
The rows of the output array X are copies of the vector x; columns of the output array Y are copies of the vector y.