# Best approach to smooth array? None of my approaches are very useful

**URL:** <https://discourse.julialang.org/t/best-approach-to-smooth-array-none-of-my-approaches-are-very-useful/17633>\
**Category:** Performance\
**Tags:** images, statistics, smoothing\
**Created:** [November 17, 2018, 5:33am UTC](https://discourse.julialang.org/t/best-approach-to-smooth-array-none-of-my-approaches-are-very-useful/17633 "2018-11-17T05:33:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [January 30, 2019, 12:39am UTC](https://discourse.julialang.org/t/best-approach-to-smooth-array-none-of-my-approaches-are-very-useful/17633/12 "2019-01-30T00:39:45Z")

</div>

Hi Tim:

Are this two things supposed to give the same output?

```julia
a = rand(10,10,10)
b = similar(a)
for i in 1:10
       b[:,:,i] = imfilter(a[:,:,i], kernelfactors(( ones(3)/3, ones(3)/3)))
end
c = imfilter(a,kernelfactors(( ones(3)/3 , ones(3)/3) , [1.0])) )

```

The question is,  
`shouldn't b==c?`  
It doesn’t, but I don’t understand why.

---

_[View the full topic](https://discourse.julialang.org/t/best-approach-to-smooth-array-none-of-my-approaches-are-very-useful/17633)._
