Face detection and automatic cropping

Applies to: Images

Version 4.2 introduced a face detection with auto cropping module into all programs with Images Mode (and Main Mode of OutPost). With the module it is possible to crop images, in bulk, to a common position and size.

Activating the face detect tools

The face detect tools are available in their own toolbar immediately the 'Crop Image Tool' is used.

Figure 1: Activating the face detect toolbar by clicking the Crop Image Tool

For users who will never use face detection it is possible to turn off the module so that it's toolbar does not appear. Do this in File>Options>Image correct

Quick start

It is envisaged that possibly the best way to use the new face detection tool is to jump straight in with some default values and learn from the results.

  1. Select all images to be cropped
  2. Enter values into the toolbar. Good starting points are 50%, 60% and 45% for align left, top and size respectively
  3. Click the Detect & Crop button
  4. Inspect the images and if needed adjust values before clicking 'Detect and Crop' again

Figure 2: Faces have been detected and cropped to a common size and position

Detecting faces

The face detection algorithm finds the eyes, nose and mouth of a face in the upright position. For this reason images where the subject is horizontal (regardless of whether the image itself is in the portrait or landscape orientation) or where the subject's head is tilted at a significant angle cannot be used.

  • Faces must be in the normal upright position. It does not matter whether the image itself is in portrait or landscape orientation
  • Faces where the head is tilted at an angle cannot be detected
  • Only one face can be detected per image

Face detection is indicated by a set of square yellow lines. (These are guidelines only and may be shown or hidden by the 'Show lines' option in the toolbar)

For the purpose of aligning and cropping detected faces it is therefore important to understand the following:

  • The centre of the box is deemed to be the centre of the face
  • The size of the box is deemed to be the size of the face

Figure 3: Face detection indicated by a square box.

Automatically aligning and sizing images

The purpose of the face detection algorithm is to then enable automatic cropping of images so that faces are a consistent size and position . To this end three adjustments are available.

It is not necessary to detect faces before cropping. To perform both steps in one cation simply select the images the click 'Detect and Crop'

  1. Align faces to the left or right
  2. Align faces up or down
  3. Size faces

The three parameters above are set with the corresponding tools on the Face Detect toolbar and are expressed as percentages of the total canvas.

To crop the images to the entered values, select the images first then click Detect and Crop

What the percentages mean

With respect to horizontal alignment the start point is deemed to be the bottom left corner of the canvas with 100% being the extreme right had side of the canvas. A value of 50% will therefore place the centre of the face midway along the x axis. A value of 75% will place the face three quarters of the way along the x-axis and so on.

With respect to vertical alignment the start point is deemed to be the bottom left corner of the canvas with 100% being the top edge of the canvas. A value of 50% will therefore place the centre of the face half way up the canvas. A value of 66% will place the face two thirds of the way up the canvas.

With respect to size, the size of the face is expressed as a percentage of the total canvas area. A value of 40% indicates the face will occupy 40% of the total canvas and so on. Note since the face is detected as a square and most images are rectangular a value of 100% is not possible..

To help with understanding the values it can be useful to remove the human elements as in the two following diagrams.

Face detected at approximately 70% left/right, 40% up/down and 40% of total canvas size Face cropped to 50% left/right, 60% up/down and 55% of total canvas size

End of article

Recent Discussions

08 May, 2018 04:24 AM
02 May, 2018 08:13 PM
04 Apr, 2018 03:46 PM
26 Mar, 2018 02:00 PM
23 Mar, 2018 09:27 AM