[ create a new paste ] login | about

Link: http://codepad.org/ylM67Lif    [ raw code | output | fork ]

C++, pasted on Jun 14:
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;
}


Output:
1
2
3
In function 'int main()':
Line 4: error: 'Mat' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: