Image Interpolation in python
Question: I am trying to use interpolation to remove chromatic aberration from an image.
The code I have generates the following error: TypeError: unhashable type:
'numpy.ndarray'. Below is my code - any help would be greatly appreciated.
Thank you- Areej This is an input explanation

    
    
    #splitting an image into its separe bands
    source = im.split()
    Cfixed = source[2]
    Cwarp  = source[1]
    #take the image minus a ew-wide edge
    roi = [ew+1, xdim-ew, ew+1, ydim-ew];
    roi_pad = [roi[0]-ew, roi[1]+ew, roi[2]-ew, roi[3]+ew];
    for k in range(0,centers_x.size):
            cx = centers_x[k]
            cy = centers_y[k]
            wz = warps[k]     
    import scipy as sp
    from scipy import interpolate
    
    def warpRegion(Cwarp, roi_pad, (cx, cy, wz)):
        #Unpack region indices
        sx, ex, sy, ey = roi_pad
        xramp, yramp = np.mgrid[sx:ex+1, sy:ey+1]
        shapeofgrid=xramp.shape
        print 'shape of x grid'+str(shapeofgrid)
        xrampc = xramp - cx;
        yrampc = yramp - cy;
        xramp1 = 1/wz*xrampc;
        yramp1 = 1/wz*yrampc;
        xrampf = xrampc.flatten()
        yrampf = yrampc.flatten() 
        xramp1f = xramp1.flatten()
        yramp1f = yramp1.flatten()
        reg_w = sp.interpolate.interp2d(yrampf,xrampf,Cwarp, yramp1f, xramp1f,'cubic');
    


Answer: A possible explanation of the error message is that you are trying to use a
NumPy array as a dict key or a set element. Look at where the error occurs and
study the type of every variable referenced on that line. If you need help,
post a runnable example and the full traceback of the exception.

