I am trying to do a trilinear interpolation for an image. I tried using two functions from scipy interpn and RegularGridInterpolator. I had this link as a reference as it explains every step https://blog.finxter.com/scipy-interpolate-1d-2d-and-3d/ but this does only work if the arrays are of equal size. The width, height and depth (rgb channel) are of different size. Besides I also saw some simple examples on stack overflow but they don't seem to be helpful as for example x = np.arange(10) but for my case it seems to be more complicated than that and throwing this error even when I already tried to sort the elements (see the code below)
python error: the points in dimension d must be strictly ascending or descending
I would be very happy if somebody can offer help!
Here is my code (still with the error mentioned above):
` x1 = blurred_img[0]
x = np.sort(x1, axis=0)
y1 = blurred_img[1]
y = np.sort(y1, axis=0)
z1 = blurred_img[2]
z = np.sort(z1, axis=0)
x_mesh, y_mesh, z_mesh = np.meshgrid(x, y, z)
points = (x, y, z)
values = func_3d(x_mesh, y_mesh, z_mesh)
point = np.array([2.5, 3.5, 1.5])
inn = interpolate.interpn(points, values, point)`