The issue in short 所以我一直工作在3D软件渲染,需要一个双线性插值方法。我正在使用一个3字节的BGR栅格来获得速度,我无法弄清楚我的代码在功能上与我直接访问图像本身的工作不同。结果之前,我会先编写代码。 float lerp(float x1, float x2, float a) {
return x1 * (1 - a) + x2 * a;
}
基本线性插值
OpenCV的remap()使用实值索引网格,使用双线性插值对图像中的值网格进行采样,并将样本网格作为新图像返回。 准确地说,让: A = an image
X = a grid of real-valued X coords into the image.
Y = a grid of real-valued Y coords into the image.
B = remap(A, X,