Hi, I am drawing a circle with opencv. But this code show me with error: (-215:Assertion failed) connectivity == 8 || connectivity == 4 in function 'LineIterator'
And I had look the document, I think cv::FILLED
is valid parameter. So I don’t know what happen. Do you have any advise?
CV_VERSION is 4.3.0
// image is mat (double type)
bool GenObj::draw_random_circles(cv::Mat& image, cv::RNG& rng)
{
int x_1 = -image.rows/2;
int x_2 = image.rows*3/2;
int y_1 = -image.rows/2;
int y_2 = image.rows*3/2;
double pd = rng.uniform(5,20);
cv::LineTypes thickness = cv::FILLED;
cv::LineTypes lineType = cv::FILLED;
cv::Point center;
center.x = rng.uniform(x_1, x_2);
center.y = rng.uniform(y_1, y_2);
int radius = rng.uniform(5, 30);
cv::circle(image, center, radius, cv::Scalar(pd), thickness, lineType, 0);
return true;
}