I'm currently using opencv framework(3.4.1) for object measuring, but I am not able to add points[4] to the contours. Please let me know how to add points[4] to the boxContours in the code below. I can pass boxContours to the drawContours only if I add points to the former.
std::vector<std::vector<cv::Point>> contours;
vector<cv::Vec4i> hierarchy;
cv::findContours( gray, contours, hierarchy, CV_RETR_EXTERNAL,
CV_CHAIN_APPROX_SIMPLE);
for (int i = 0; i< contours.size(); i++)
{
cv::RotatedRect rect = cv::minAreaRect(contours[i]);
cv::Point2f points[4];
rect.points(points);
std::vector<std::vector<cv::Point2f>> boxContours;
cv::drawContours(image, boxContours, i,cvScalar(0,255,0),2);
}