JuliaImages / JuliaImages/ImageFiltering.jl
padarray inconsistent behavior for n=1 axes
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 104
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
I found the following surprising.
n = 0
x = rand(50,100);
xr = repeat(x,outer=[1 1 n])
println(size(xr))
pxr = ImageFiltering.padarray(xr,ImageFiltering.Pad(:reflect,(5,5,0)));
println(size(pxr))
For n!=1 this succeeds and pads the repeated matrix which is of dimension (50,100,n) to be (60,110,n). For n=1, this fails with the following error message.
"DimensionMismatch: supplied axes do not agree with the size of the array (got size (1,) for the array and (0,) for the indices"
Maybe there is something I am not understanding, but I would have expected the n=1 case to behave similarly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue from the supplied Julia example, comparing ImageFiltering.padarray for n=0, n=1, and another non-1 value with the reflected padding arguments. Trace the padarray entry point and the dimension or axes handling involved; done means the n=1 case produces the expected padded size without the DimensionMismatch.
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
- Mostly clear
- Newbie friendliness
- 35/100