update to opencv3.0

opencv changed to a c++ api (using cv::Mat) in 2010, the upcoming 3.0 version will make it much harder to use IplImages, let's change those !

(using templated Mat_<double> instead of vector<vector<double> also reduces a third of the time needed.)