//This is just a version of opencv that treats differently the waitKey function. So the answer is to change it fro cvWai