JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 49 forks source link

Documentation of Pad inconsistent #84

Closed rapus95 closed 4 years ago

rapus95 commented 5 years ago

As far as i can tell, the examples for :reflect and :symmetric in padarray are contrary to the definitions of the symbols in Pad in that they are switched

timholy commented 5 years ago

Can you be a bit more explicit? I'm not seeing what you're seeing.

rapus95 commented 5 years ago

In the :symmetric example of padarray the border line is duplicated outside though for the :symmetric example in Pad it is not (border is e d c b | a b c d ...)

timholy commented 5 years ago

Got it now. Yes, you are right. Want to submit a pull request fixing it?

rapus95 commented 5 years ago

First I'd need to know which one is the correct one, then I can swap headings.

timholy commented 5 years ago

Oh, I see. The ultimate source is usually (though not always) the code itself:

julia> using ImageFiltering

julia> a = [1,2,3,4]
4-element Array{Int64,1}:
 1
 2
 3
 4

julia> padarray(a, Pad(:symmetric, 2))
OffsetArray(::Array{Int64,1}, -1:6) with eltype Int64 with indices -1:6:
 2
 1
 1
 2
 3
 4
 4
 3

julia> padarray(a, Pad(:reflect, 2))
OffsetArray(::Array{Int64,1}, -1:6) with eltype Int64 with indices -1:6:                                                                                                                                                                     
 3                                                                                                                                                                                                                                           
 2                                                                                                                                                                                                                                           
 1                                                                                                                                                                                                                                           
 2                                                                                                                                                                                                                                           
 3                                                                                                                                                                                                                                           
 4                                                                                                                                                                                                                                           
 3                                                                                                                                                                                                                                           
 2