Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cvWaitKey is not generating key codes for naviagation keys

I have involved with opencv key finction ie cvWaitKey(0).whenever i press the "r" key the point on opencv image window is moving right direction, for "L" towards left ,for "u" upward direction as bbellow.

        while(true)
        {
            int key = cvWaitKey(0);
            cout<<"key="<<key<<endl;
            if (key == 'u'){
                y -= 1;
                globalCoordinateY[point]=y;
            }else if(key=='d'){
                y += 1;
                globalCoordinateY[point]=y;
            }else if(key=='l'){
                x -= 1;
                globalCoordinateX[point]=x;
            }else if(key=='r'){
                x+= 1;
                globalCoordinateX[point]=x;
            }
            showImage();
        }

yes it works fine.

My problem is with arrow keys cvWaitKey(0) not working. Does Opencv provide a another function?if not can anyone give me suggestion about how to do that?

Thanking You.

cvWaitKey is not generating key codes for naviagation keys

I have involved with opencv key finction function ie cvWaitKey(0).whenever i press the "r" key the point on opencv image window is moving right direction, for "L" towards left ,for "u" upward direction as bbellow.bellow.

        while(true)
        {
            int key = cvWaitKey(0);
            cout<<"key="<<key<<endl;
            if (key == 'u'){
                y -= 1;
                globalCoordinateY[point]=y;
             }else if(key=='d'){
                y += 1;
                globalCoordinateY[point]=y;
             }else if(key=='l'){
                x -= 1;
                globalCoordinateX[point]=x;
             }else if(key=='r'){
                x+= 1;
                globalCoordinateX[point]=x;
             }
            showImage();
        }

yes it works working fine.

My problem is with arrow keys the function cvWaitKey(0) is not working. Does Opencv provide a another function?if function? if not can anyone give me suggestion about how to do that?

Thanking You.