cv::ellipse does not fill in some cases (Bug #4013)
Description
Originally from http://answers.opencv.org/question/50896/cvellipse-does-not-fill-when-drawing-out-of-the-m/
cv::ellipse does not fill the ellipse portion if the length of the axis is too high in some specific cases.
Here is an output showing the errors: http://www.tiikoni.com/tis/view/?id=197b66d
Here is a code sample:
int main(int argc, char* argv[]) {
cv::Mat mat1(300, 300, CV_8UC1);
mat1.setTo(0);
cv::Mat mat2(300, 300, CV_8UC1);
mat2.setTo(0);
cv::Mat mat3(300, 300, CV_8UC1);
mat3.setTo(0);
cv::Mat mat4(300, 300, CV_8UC1);
mat4.setTo(0);
int axis = 270;
cv::ellipse(mat1, cv::Point2i(mat1.cols*0.5f, mat1.rows * 0.5f),
cv::Size(axis, axis), -45, +10, -10, cv::Scalar(255), -1);
cv::ellipse(mat2, cv::Point2i(mat2.cols*0.5f, mat2.rows * 0.5f),
cv::Size(axis, axis), -45, +20, -20, cv::Scalar(255), -1);
cv::ellipse(mat3, cv::Point2i(mat3.cols*0.5f, mat3.rows * 0.5f),
cv::Size(axis, axis), 45, +10, -10, cv::Scalar(255), -1);
axis = 260;
cv::ellipse(mat4, cv::Point2i(mat4.cols*0.5f, mat4.rows * 0.5f),
cv::Size(axis, axis), -45, +10, -10, cv::Scalar(255), -1);
cv::imshow("MAT1", mat1);
cv::imshow("mat2", mat2);
cv::imshow("mat3", mat3);
cv::imshow("mat4", mat4);
cv::waitKey(0);
return 0;
}
History
Updated by Artur Wieczorek over 10 years ago
See PR3447
Updated by Artur Wieczorek over 10 years ago
Fixed in PR3447
- % Done changed from 0 to 100
- Status changed from New to Done