you are inside cv namespace. using cv:: is unnecessary and makes the code more difficult to read. Also, you can put "using std::vector;" somewhere in the beginning (after "namespace cv {") and then just use vector instead of std::vector.