Hello All,
I am fairly new to OpenCV library.
I observed a behavior of the fillPoly opencv function.
When I draw to polygons with the exact same co-ordinates twice, the fillPoly function clears the filled polygon.
I would like to know whether it is an expected beahvior of the fillPoly function
Below is the sample snippet of my code
void CreateTestImage(){
cv::Mat image_buffer = cv::Mat::zeros( 200, 200, CV_8UC3 );
std::vector< std::vector< cv::Point > > polygons;
std::vector< cv::Point > poly1 { cv::Point(155,155),
cv::Point(155,195),
cv::Point(195,195),
cv::Point(195,155),
cv::Point(155,155),
};
polygons.push_back(poly1);
// on addition of this line the polygon is non-filled.
// when I comment this line, I get a filled polygon
polygons.push_back(poly1);
auto ncolor = cv::Scalar(0,255,255);
fillPoly( image_buffer,polygons,ncolor,cv::LINE_8 );
std::string imageFile("test-1.png");
cv::imwrite(imageFile,image_buffer);
}
Thanks in advance