I am not sure what I am doing wrong. This is my code:
subs(img, t) = img[1:round(Int, t):end, :];
delT = sqrt(2); n = 5; b = 72;
t_all = [delT^i for i in 0:5];
k = 2; t = 2;
theta = k*b/t;
tfm = LinearMap(RotMatrix(theta));
uR = warp(img1, inv(tfm));
uF = imfilter(uR, KernelFactors.gaussian((0, 0.8*t)));
# Here is the error:
uT = subs(uF, t);
Stacktrace:
[1] errmsg(::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}) at /home/subhankar/.julia/v0.6/OffsetArrays/src/OffsetArrays.jl:94
[2] sqrt_restrict(::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}, ::Int64) at ./In[21]:1
Thanks a lot for the reply. Actually the paper I am trying to implement says I need to rotate the image and then subsample in vertical direction(hence the subs function). I am confused how I can still subsample vertically.
Yes, it’s an array who’s indices do not run from 1 to n, instead from some other number. From your error message it’s from -671 to -1 and -546 to 138. For these, so-called offset arrays, you need to do a few special things, which are described in that section of the docs, for instance instead of size you need to use axes, the docs indeed state: "replace many uses of size with axes. Please read the chapter of the docs first before asking more questions.