I am getting Inexact Error in qfunc, where I am applying the Nearest 
Neighbor to the input image array. 

julia> qfunc()
ERROR: InexactError()
 in getindex at array.jl:289
 in qfunc at none:2


function qfunc()
    value = A[col/scale_x, row/scale_y]
    new_image_data[col,row,value] = A[col,row]
     end

This is being called in the rescale function as: 

function rescale(scale_x,scale_y)
         img = imread("index.png")
         h = height(img)
         w = width(img)
         new_h = int(h*scale_y)
         new_w = int(w*scale_x)
         A = data(img) 
         for col=1:new_w
         for row=1:new_h
         qfunc()
         end
         end
         new_image = InterpGrid(new_image_data, BCnil, InterpGrid)

After going through the threads on this group, I found that Inexact error 
is usually when matrix multiplication/division is going wrong. So I may 
probably be wrong in the way I am indexing the two arrays. Please suggest 
what should I change. 

Reply via email to