Bugfix 3406

Added bugfix 3406
However, since this is also available in branch 2.4 I think a fix should be add here and not in master.
We want correct python bindings here too.

http://code.opencv.org/issues/3406