int main()
{
Mat image(500, 500, CV_8U);
int row, col, k;
Point center = {250, 250};
float long_axis = 100, short_axis = 50;
for (row = 0; row<image.rows; row++)
{
for (col = 0; col<image.cols; col++)
{
if (pow(row - center.y, 2)/pow(long_axis, 2) + pow(col - center.x, 2)/pow(short_axis, 2) <1.0 )
image.at<uchar>(row, col) = 255;
else
image.at<uchar>(row, col) = 0;
}
}
namedWindow("", 2);
imshow("", image);
waitKey(0);
return 0;
}