ripping out all OpenCV1 code from binscontour, except that needed by SVR