1
$\begingroup$

I am trying to evaluate the symmetry of an image with Matlab. My approach is far is based on:

  • convert image to BW
  • get 2D gaussian from the BW pixel cloud
  • get center and axis
  • rotate to get horizontal and vertical axis
  • mirror from center to the right
  • compare (left side) with (mirrored right side) using MSE

The results are usually ok but I think that maybe this could be improved for shapes with unusual contours.

Any alternative or suggestion for improvement?

$\endgroup$
3
  • $\begingroup$ Could you share an image for reference? $\endgroup$
    – Royi
    Commented May 12, 2018 at 8:31
  • $\begingroup$ What is “get 2D Gaussian”? Are you fitting a Gaussian? Applying a Gaussian filter? $\endgroup$ Commented May 22, 2018 at 12:47
  • $\begingroup$ I am working with medical images (usually with symmetry) but they are not always centered. If you consider all the white points (image) as calculate a gaussian (1 cluster) then you can find the horizontal and vertical center. $\endgroup$ Commented May 22, 2018 at 14:54

2 Answers 2

1
$\begingroup$

A practical approach with centering, filtering, derivative, etc. may provide some results. Taking a step back on associated properties, for instance in the Fourier domain, may give you different insights, since symmetry is not well-defined per se (local or global, radial or axis, etc.). I am thinking specifically of the phase-based approach in Peter Kovesi, Symmetry and Asymmetry from Local Phase, 1997:

Symmetry is an important mechanism by which we identify the structure of objects. Man-made objects, plants and animals are usually highly recognizable from the symmetry, or partial symmetries that they often exhibit. Two difficulties found in most symmetry detection algorithms are firstly, that they usually require objects to be segmented prior to any symmetry analysis, and secondly, that they do not provide any absolute measure of the degree of symmetry at any point in an image. This paper presents a new measure of symmetry that is based on the analysis of local frequency information. It is shown that points of symmetry and asymmetry give rise to easily recognized patterns of local phase. This phase information can be used to construct a contrast invariant measure of symmetry that does not require any prior recognition or segmentation of objects.

Here are examples for testing local symmetry:

https://www.peterkovesi.com/matlabfns/WWWImages/whalesm.jpg https://www.peterkovesi.com/matlabfns/WWWImages/whalesmsym.jpg

And some Matlab code, for instance phasesym.m in Peter Kovesi Matlab functions.

$\endgroup$
0
$\begingroup$

One suggestion could be using image derivative. To get rid of effects of different shading and light, instead of BW, use derivative of the image in step 1.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.