How to define arrays in C++/ Open CV as I do in matlab ?
for example:
x=a:b:c;
or
y=linspace(a,b,n);
How to define arrays in C++/ Open CV as I do in matlab ?
for example:
x=a:b:c;
or
y=linspace(a,b,n);
This is a simple implementation if you use openCV.
Mat linspace(double &startP,double &Endp,int &interval)
{
double spacing = interval-1;
Mat y(spacing,1,CV_64FC1);
for (int i = 0; i < y.rows; ++i)
{
y.at<double>(i) = startP + i*(Endp - startP)/spacing;
}
return y;
}