Ask Your Question

Sveta's profile - activity

2014-06-17 12:23:32 -0600 answered a question Face Detection is not working portrait mode in android plateform

faces that are detected are detected based on transposed and flipped gray Matrix. So you should flip your Rect coordinates also.

This is how i did it.

Core.transpose(mGray, mGray);
Core.flip(mGray, mGray, 0);

and when you draw Rectangle you do this :

for(int i=0, f=mFacesArray.length; i<f; i++){
tl.x = mFacesArray[i].tl().y;
tl.y = mFacesArray[i].tl().x;
br.x = mFacesArray[i].br().y;
br.y = mFacesArray[i].br().x;
Core.rectangle(mRgba, tl, br, STROKE_COLOR, 3);
}

tl and br are Point objects of course.