if (marker.numDetected>0 && marker.numDetected<10){
marker.getMatrix(7, m);
glMatrixMode( GL_MODELVIEW );
glLoadMatrixf( m );
cvRect(0,50,20,20);
glPushMatrix();
glEnable(GL_DEPTH_TEST);
ofBackground(255, 255, 255);
botao.draw(0,50,20,20);
cvSetImageROI(grayDiff.getCvImage(),cvRect(0,50,20,20);
buttonImg.scaleIntoMe(grayDiff);
countBlackPixels();
squirrelModel.draw();
glPopMatrix();
}
As you can see in this bit of code i’m getting the transformation matrix from the AR marker and i’m drawing a button with the same orientation. What i want to do now is to extract the pixels of the original image where the button is being drawn, so that i can evaluate whether somebody is “clicking” on it or not.
I thought this way the cvRect would also be altered by the matrix. But no, i keep on cropping the same rectangle over and over. How can i acess the coordinates of the image after the matrix transformation?
Regards