Fix issue in boxFilter with destination depth not equal to source depth.
Add check for depths of destination and source image. Fix warning C4127.