Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So you really just want to draw the radius in that circle? I mean, to draw the circle, you already have the center and the radius itself. So you can just use cv::line() to draw the radius.

cv::line(img, center, cv::Point(center.x + radius, center.y), cv::Scalar(255, 255, 255))

So you really just want to draw the radius in that circle? I mean, to draw the circle, you already have the center and the radius itself. So you can just use cv::line() to draw the radius.

cv::line(img, center, cv::Point(center.x + radius, center.y), cv::Scalar(255, 255, 255, 255))

So you really just want to draw the radius in that circle? I mean, to draw the circle, you already have the center and the radius itself. So you can just use cv::line() to draw the radius.

cv::line(img, center, cv::Point(center.x + radius, center.y), cv::Scalar(255, 255, 255, 255))


char buffer[256];
sprintf(buffer, "Radius: %f", radius);
cv::putText(img, std::string(buffer), cv::Point(0,32), cv::FONT_HERSHEY_PLAIN, 1, cv::Scalar(255,255,255,255));