1 year ago

#361683

test-img

Krupali Mistry

convert opencv vector Point2f to vector Point

I want to convert the centers obtained by contouring of type vector<Point2f>centers(contours.size()); to integer points so that I can plot the centers. If I print out the centers then they are all in floating point, so how to convert this vector floating points to integer floating points?

cout << "Center:" << centers[i] << endl;
Output : Center:[474.273, 273.845]

I want to round up the values so that I can use this points to plot coordinates on the image.

c++

opencv

vector

point

0 Answers

Your Answer

Accepted video resources