使用 ILNumerics,我试图以最有效的方式获取 ILArray<> 的前 n 列。
using(ILScope.Enter(inframe)
{
ILArray<complex> frame = ILMath.check(inframe);
int[] dims = frame.Size.ToIntArray(); //frame is a 2d ILArray
frame.SetRange(complex.Zero, dims[0] -1 , (dims[1] * 2 - 1)); //doubles the size of the array with zeros.
//TODO- various computations.
frame.SetRange(null, dims[0], dims[1] - 1); //EXCEPTION: why doesn't this work?
}
在这个例子中,我试图只取帧的前半部分,但我无法将其调整回原始尺寸。我已经尝试了基于http://ilnumerics.net/ArrayAlter.html的各种排列,但都没有成功。