Face cropping - OpenCV eye detection

Long time programmer, first time OFer.

Given an image (face.png on disk, unknown size and aspect ratio)
that likely has a face in it (or more, first or largest is fine, dont really care at the point)
I would like to fit the first face to a 1000x1000 image where the eyes are at (333,333) and (666,333) .

It is going to be displayed on a physical;y square display, so the aspect ratio will be 1:1, regardless of what OpenCV says the bounding box is. which is why it seems like a good idea to find the eyes and use that to drive the cropping.

I am happy to entertain other ideas, especially if you can point me to code that already does something. I am in R&D mode, so the exact goal can move around if something is easier.

Hi @CarlFK have a look at the example in oF/examples/computer_vision/opencvHaarFinderExample this may be the simplest place to start. (of many approaches that will do what you want) the cascade classifier will return you a bounding box where the face is and you can also use classifiers to find the eye positions,
once you know the positions you can do transform and scaling to make your image fit your presentation box…