vector hull; vector defects; convexHull(Mat(largest),hull,false); convexityDefects(largest,hull,defects);
*largest i
The second argument of convexityDefects has to be the type of vector, while yours is vector.
convexityDefects
vector