1 | initial version |
see image attached.
the code:
std::string filename = "ellipse_ver.png"; cv::Mat image = cv::imread(filename, CV_LOAD_IMAGE_GRAYSCALE); if (image.empty()){ return -1; }
std::vector<std::vector<cv::point>> contours; cv::findContours(image.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE); cv::RotatedRect r = cv::fitEllipse(contours.at(0));
2 | No.2 Revision |
see image attached.
the code:
std::string filename = "ellipse_ver.png";
"ellipse_ver.png";
cv::Mat image = cv::imread(filename, CV_LOAD_IMAGE_GRAYSCALE);
CV_LOAD_IMAGE_GRAYSCALE);
if (image.empty()){
return -1;
}
}
std::vector<std::vector<cv::point>> contours;
std::vector<std::vector<cv::point>> contours;
cv::findContours(image.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
CV_CHAIN_APPROX_NONE);
cv::RotatedRect r = cv::fitEllipse(contours.at(0));
3 | No.3 Revision |
see image attached.
the code:
std::string filename = "ellipse_ver.png";
std::vector<std::vector<cv::point>> contours;
cv::findContours(image.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
cv::RotatedRect r = cv::fitEllipse(contours.at(0));