Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

resolution not responding properly to query

2 questions : -If i set the resolution, then query it after, it doesn't (always) show up. Sometimes it does. But it's not consistent. -I'm not getting any return value in lvl1,2 or 3. Doesn't capture.get return a double?

I know most of this is old syntax, i'm converting as i go along. Maybe that's the reason for the resolution reporting value being inconsistent. And yes i know i'm setting CAP_PROP_FRAME_WIDTH, and querying CV_CAP_PROP_FRAME_WIDTH. I can't set CV_CAP_PROP_FRAME_WIDTH, that's why :-)

    capture.set(cv::CAP_PROP_FRAME_WIDTH, 320);
    capture.set(cv::CAP_PROP_FRAME_HEIGHT, 240);

    // We'll allow these values to be adjusted later in our program
    // but as a default we base them on resolution
    cout << capture.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
    cout << capture.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
    lvl1=capture.get(CV_CAP_PROP_FRAME_WIDTH/30);
    lvl2=capture.get(CV_CAP_PROP_FRAME_WIDTH/20);
    lvl3=capture.get(CV_CAP_PROP_FRAME_WIDTH/10);
    cout << "Level 1 threshold set to: " << lvl1 << endl;
    cout << "Level 2 threshold set to: " << lvl2 << endl;
    cout << "Level 3 threshold set to: " << lvl3 << endl;

Any idea's would be appreciated.

resolution not responding properly to query

2 questions : -If i set the resolution, then query it after, it doesn't (always) show up. Sometimes it does. But it's not consistent. -I'm not getting any return value in lvl1,2 or 3. Doesn't capture.get return a double?consistent.

I know most of this is old syntax, i'm converting as i go along. Maybe that's the reason for the resolution reporting value being inconsistent. And yes i know i'm setting CAP_PROP_FRAME_WIDTH, and querying CV_CAP_PROP_FRAME_WIDTH. I can't set CV_CAP_PROP_FRAME_WIDTH, that's why :-)

    capture.set(cv::CAP_PROP_FRAME_WIDTH, 320);
    capture.set(cv::CAP_PROP_FRAME_HEIGHT, 240);

    // We'll allow these values to be adjusted later in our program
    // but as a default we base them on resolution
    cout << capture.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
    cout << capture.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
    lvl1=capture.get(CV_CAP_PROP_FRAME_WIDTH/30);
    lvl2=capture.get(CV_CAP_PROP_FRAME_WIDTH/20);
    lvl3=capture.get(CV_CAP_PROP_FRAME_WIDTH/10);
lvl1=capture.get(CV_CAP_PROP_FRAME_WIDTH)/30;
    lvl2=capture.get(CV_CAP_PROP_FRAME_WIDTH)/20;
    lvl3=capture.get(CV_CAP_PROP_FRAME_WIDTH)/10;
    cout << "Level 1 threshold set to: " << lvl1 << endl;
    cout << "Level 2 threshold set to: " << lvl2 << endl;
    cout << "Level 3 threshold set to: " << lvl3 << endl;

Any idea's would be appreciated.