The function returns the vertical and horizontal mirror symmetry of
an image img
. Symmetry values can range between 0 (not symmetrical)
and 1 (fully symmetrical). If vertical
or horizontal
is set
to FALSE
then vertical or horizontal symmetry is not computed,
respectively.
As the perceptual mirror axis is not necessarily exactly in the middle of a
picture, the function estimates in a first step several symmetry values
with different positions for the mirror axis. To this end, the mirror axis
is automatically shifted up to 5% (default) of the image width to the left
and to the right (in the case of vertical symmetry; analogously for
horizontal symmetry). In the second step, the overall symmetry score is
computed as the maximum of the symmetry scores given the different mirror
axes. See Mayer & Landwehr (2018) for details.
Advanced users can change the shift range with the optional parameter
shift_range
, which takes a numeric decimal as input. The default
shift_range = 0.05
(i.e., 5%).
For color images, the default is that first a maximal symmetry score (as
explained above) is obtained per color channel (parameter per_channel
= TRUE
). Subsequently, a weighted average between each color channel's
maximal score is computed as the image's overall symmetry. Advanced users
can reverse this order by setting per_channel = FALSE
. This results
in first computing the weighted averages for each position of the mirror
axis separately, and afterwards finding the maximal overall symmetry score.