Android window orientation

Hi everyone,

I’m working on an android app with openframwork. I run the OpenCvCameraFaceExample ( detect faces on android ) on my device (nexus 4) , and i got this weird problem.
I can’t set the orientation of my window, even with setOrientation(); , app always open like this. I try to fix it in the android xml file but it just force portrait mode .
Here a picture :

Thx for reading,

It seems to be an Android problem on 4.0+ devices …
So i rotate my grabber view, it works fine, but faceDection doesn’t work with this orientation. I think it’s because my grabber pixels are still in the wrong orientation
I try to rotate my pixels like this :

void update :

imageCv.setFromPixels( grabber.getPixelsRef());
imageCv.setAnchorPoint(imageCv.getWidth()/2, imageCv.getHeight()/2);

//if i set rotate90(0) it work fine but faceDetection is still in the wrong orientation  

colorCv = imageCv.getPixels();
colorCvSmall.scaleIntoMe(colorCv, CV_INTER_NN);
grayCv = colorCvSmall;
faces = faceFinder.blobs;

And on my draw

grabber.draw(0, -480);

There is maybe an other way to do the trick by change setting/rotation in “haarcascade_frontalface_default.xml”, but it i have no idea how to do it .

I’m pretty new to of, so my code is very basic, sorry.

thx for reading :slight_smile:

I am having the same issue. Did you work this out?

I was able to fix it by adding android:screenOrientation to the activity section of the AndroidManifest file: