# How to access points from convexHull-vector?

Hello,

I use the function "convexHull" and I would like to know how I can access every vector point of a convex hull object.

For example I use this code:

              /// Find the convex hull object for each contour
vector<vector<Point> >hull( contours_vec.size() );
for( int i = 0; i < contours_vec.size(); i++ )
{  convexHull( Mat(contours_vec[i]), hull[i], false ); }

/// Draw contours + hull results Mat
Mat drawing = Mat::zeros( Dilated.size(), CV_8UC3 );
for( int i = 0; i< contours_vec.size(); i++ )
{
Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) );
drawContours( drawing, contours_vec, i, color, 1, 8, vector<Vec4i>(), 0, Point() );
drawContours( drawing, hull, i, color, 1, 8, vector<Vec4i>(), 0, Point() );


If I now use "cout << hull[i] << endl;" I get something like this for every contour:

[812,176; 810,182; 805,190; 812, 173].

How can I access just for example the point 805, 190?

I tried hull[i].something, but it did not work.

Thank you very much. :-)

edit retag close merge delete

hull[i] is a vector<Point>, so, hull[i][j] is the j'th Point in the i'th contour.