Draw a circle error: (-215:Assertion failed)

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;

}

I cannot reproduce your error after 100000 call of draw_random_circle. Can you give image size and type and all parameter values for circle?

lineType in cv::circle can not be cv::FILLED. Try this:
cv::circle(image, center, radius, cv::Scalar(pd), thickness, cv::LINE_4, 0);
or
cv::circle(image, center, radius, cv::Scalar(pd), thickness, cv::LINE_8, 0);