Ask Your Question

Revision history [back]

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.