JuliaImages / JuliaImages/ImageFiltering.jl

ERROR: ... lacks the proper padding sizes for an array with 2 dimensions

Open
#66 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
104
Forks
52
PR merge metrics
No merged PRs in 30d

Description

I'm not entirely sure what is happening here. I'm trying to filter an image before resizing it, as recommended by the Images.jl docs. Running:

reduction_factor = new_len/minimum(size(im)[1:2])
im = imfilter(im, KernelFactors.gaussian(0.75*reduction_factor))

Results in:

ERROR: ArgumentError: ImageFiltering.Pad{1}(:replicate, (2,), (2,)) lacks the proper padding sizes for an array with 2 dimensions
Stacktrace:                                                                                                              
 [1] padindices(::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}, ::ImageFiltering.Pad{1}) at /home/sabae/.julia/v0.6/ImageFiltering/src/border.jl:240
 [2] padarray at /home/sabae/.julia/v0.6/ImageFiltering/src/border.jl:657 [inlined]                                      
 [3] imfilter! at /home/sabae/.julia/v0.6/ImageFiltering/src/imfilter.jl:702 [inlined]                                    
 [4] imfilter!(::Array{ColorTypes.RGB{Float64},2}, ::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}, ::Tuple{OffsetArrays.OffsetArray{Float64,1,Array{Float64,1}}}, ::ImageFiltering.Pad
{0}, ::ImageFiltering.Algorithm.FIR) at /home/sabae/.julia/v0.6/ImageFiltering/src/imfilter.jl:613
 [5] imfilter!(::Array{ColorTypes.RGB{Float64},2}, ::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}, ::Tuple{OffsetArrays.OffsetArray{Float64,1,Array{Float64,1}}}, ::ImageFiltering.Pad
{0}) at /home/sabae/.julia/v0.6/ImageFiltering/src/imfilter.jl:607
 [6] imfilter(::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}, ::OffsetArrays.OffsetArray{Float64,1,Array{Float64,1}}) at /home/sabae/.julia/v0.6/ImageFiltering/src/imfilter.jl:5

Trying out different padding arguments doesn't lead to much success except for the Inner() scheme, which is what I'm using for now (since I'm resizing from thousands of pixels on a side down to hundreds, so these boundary conditions don't matter much to me)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two-dimensional RGB image case from the report, then inspect the padding checks in ImageFiltering/src/border.jl and the imfilter call path in ImageFiltering/src/imfilter.jl. Done means the reported padding schemes handle the two-dimensional input without the padding-size ArgumentError, with coverage for the demonstrated call.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.