Japar Jarkinbek Japar Jarkinbek - 22 days ago 6
C++ Question

How to get vector<Vec4i> points in OpenCV

I want to get vector points for example:

vector<Vec4i> hierarchy;



hierarchy[0]=[23,34,45,56];
hierarchy[1]=[45,12,0,99];


hierarchy[0].point[0]=23;
hierarchy[0].point[3]=56;

Answer

You don't need to use the .point method on the vec4i object, you may simply access the values as you access a 2D array.

vector<Vec4i> hierarchy;

hierarchy[0]=[23,34,45,56];
hierarchy[1]=[45,12,0,99];

hierarchy[0][0]=23;
hierarchy[0][3]=56;
Comments