Bugfix 3206

Fixed bug # 3206
Added fix mentioned in this and related topic: http://code.opencv.org/issues/3206#note-2