fixed bug #3341

see http://code.opencv.org/issues/3341