# Size not supported for arrays with axes

**URL:** https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes/12930
**Category:** General Usage
**Created:** [August 6, 2018, 9:23am UTC](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes/12930 "2018-08-06T09:23:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![microlifecc](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@microlifecc](https://discourse.julialang.org/u/microlifecc)
#### Post date: [August 6, 2018, 9:23am UTC](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes/12930/1 "2018-08-06T09:23:20Z")

</div>

Hi Guys!

I have an error:

```julia
for t in [delT^i for i in 0:5]
    k = 0;
    if t == 1.0
        kptTheta = [];
        theta = 0;
        kpts = Keypoints(fastcorners(img1, 12, 0.35));
        push!(kptTheta, kpts);
        push!(kpT, kptTheta);
    else
        kptTheta = [];
        while k*b/t < 180
            theta = k*b/t;
            tfm = Translation((r/2)-1,(c/2)-1) ∘ LinearMap(RotMatrix(-theta)) ∘ Translation(-((r/2)-1),-((c/2)-1));
            uR = warp(img1, inv(tfm));
            uF = imfilter(uR, KernelFactors.gaussian((0, 0.8*t)));
            uT = subSam(uF, axes(uF)[1][1], axes(uF)[1][end], t);
            kpts = Keypoints(fastcorners(uT, 12, 0.35));
            push!(kptTheta, kpts);
            k += 1;
        end
        push!(kpT, kptTheta);
    end
end

```

> size not supported for arrays with axes (1:105, 1:140); see [http://docs.julialang.org/en/latest/devdocs/offset-arrays/](http://docs.julialang.org/en/latest/devdocs/offset-arrays/)
> 
> Stacktrace:  
> [1] errmsg(::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}) at /////////////////////////////////////////////////home/subhankar/julia/JuliaPro-0.6.4.1/JuliaPro/pkgs-0.6.4.1/v0.6/OffsetArrays/src/OffsetArrays.jl:94  
> [2] setindex\_shape\_check at ./indices.jl:150 [inlined]  
> [3] macro expansion at ./multidimensional.jl:554 [inlined]  
> [4] \_unsafe\_setindex!(::IndexLinear, ::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}, ::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}, ::UnitRange{Int64}, ::UnitRange{Int64}) at ./multidimensional.jl:549  
> [5] macro expansion at ./multidimensional.jl:541 [inlined]  
> [6] \_setindex! at ./multidimensional.jl:537 [inlined]  
> [7] setindex! at ./abstractarray.jl:968 [inlined]  
> [8] padarray(::Type{ColorTypes.Gray{Float64}}, ::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}, ::ImageFiltering.Fill{Int64,2}) at /////////////////////////////////////////////////home/subhankar/julia/JuliaPro-0.6.4.1/JuliaPro/pkgs-0.6.4.1/v0.6/ImageFiltering/src/border.jl:905  
> [9] fastcorners(::OffsetArrays.OffsetArray{ColorTypes.Gray{Float64},2,Array{ColorTypes.Gray{Float64},2}}, ::Int64, ::Float64) at /////////////////////////////////////////////////home/subhankar/julia/JuliaPro-0.6.4.1/JuliaPro/pkgs-0.6.4.1/v0.6/Images/src/corner.jl:247  
> [10] macro expansion at ./In[6]:17 [inlined]  
> [11] anonymous at ./:?

```julia
subSam(img, rS, rE, t) = img[rS:round(Int, t):rE, :];

```

I can’t make out what the error is.

Any suggestions please?

Thanks!

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [August 7, 2018, 3:10am UTC](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes/12930/2 "2018-08-07T03:10:50Z")

</div>

`warp` produces an `OffsetArray`, which is not acceptable to `fastcorners`. Try putting `uR=parent(warp(img1, inv(tfm)))`. You may have to check that your indices still work out. Also, the `RotMatrix` constructor wants radians, not degrees.

---

<div class="post-metadata">

### Author: ![microlifecc](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@microlifecc](https://discourse.julialang.org/u/microlifecc)
#### Post date: [August 7, 2018, 4:09am UTC](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes/12930/3 "2018-08-07T04:09:07Z")

</div>

Thanks @Ralph_Smith.

I am trying as you said.
