updated to work with opencv-2.4.9