Bilateral filter implemented on image3