Erik, your solution is working for me! Thanks a lot!
Hi, I also have the same problem on Raspberry Pi with OpenCV2 (I guess it is 2.4.10)....