Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.
Ask Your Question

Revision history [back]

Some people use values instead of constant. IMHO it's bad usage. You should use constant Like cv::WINDOW_NORMAL or IMREAD_UNCHANGED

cv::WINDOW_NORMAL and cv::WINDOW_KEEPRATIO yes same value but a window with attribute WINDOW_NORMAL is a windows with a fixed ratio because free ratio bit is set to 0.

Some people use values instead of constant. IMHO it's bad usage. You should use constant Like cv::WINDOW_NORMAL or IMREAD_UNCHANGED

cv::WINDOW_NORMAL and cv::WINDOW_KEEPRATIO yes same value but a window with attribute WINDOW_NORMAL is a windows with a fixed ratio because free ratio bit is set to 0.

you can try some combinations to understand well

    Mat test(400, 400, CV_8UC3, Scalar(120, 120, 120));
    circle(test, Point(200, 200), 100, Scalar(0, 0, 255), 5);
    namedWindow("Test", WINDOW_NORMAL);
    namedWindow("Test0", WINDOW_NORMAL & WINDOW_KEEPRATIO);
    namedWindow("Test1", WINDOW_AUTOSIZE);
    namedWindow("Test2", WINDOW_AUTOSIZE & WINDOW_KEEPRATIO);
    imshow("Test", test);
    imshow("Test0", test);
    imshow("Test1", test);
    imshow("Test2", test);
    waitKey();

Some people use values instead of constant. IMHO it's bad usage. You should use constant Like cv::WINDOW_NORMAL or IMREAD_UNCHANGED

cv::WINDOW_NORMAL and cv::WINDOW_KEEPRATIO yes same value but a window with attribute WINDOW_NORMAL is a windows with a fixed ratio because free ratio bit is set to 0.

you can try some combinations to understand well

    Mat test(400, 400, test(2400, 2400, CV_8UC3, Scalar(120, 120, 120));
    circle(test, Point(200, 200), 100, Point(1200, 1200), 900, Scalar(0, 0, 255), 5);
35);
    namedWindow("Test1", WINDOW_AUTOSIZE);
    namedWindow("Test", WINDOW_NORMAL);
    namedWindow("Test0", WINDOW_NORMAL & WINDOW_KEEPRATIO);
    namedWindow("Test1", WINDOW_AUTOSIZE);
    namedWindow("Test2", WINDOW_AUTOSIZE & WINDOW_KEEPRATIO);
    imshow("Test", test);
    imshow("Test0", test);
    imshow("Test1", test);
    imshow("Test2", test);
    waitKey();