Symmetry analysis

This module contains functions to compute the degree of symmetry of an image. - Symmetry by QuadTree Decomposition

Created on Mon Apr 16 11:49:45 2018

@author: giulio

symmetry.getSymmetry(img, minStd, minSize, plot=False)

This function returns the degree of symmetry (0-100) between the left and right side of an image

Parameters:img (numpy.ndarray) – img to analyze
MinStd:Std threshold for subsequent splitting
MinSize:Size threshold for subsequent splitting, in pixel
Returns:degree of vertical symmetry
Return type:float
class symmetry.quadTree(img, minStd, minSize)

This class is used to perfrom a QuadTree decomposition of an image.

During initialization, QuadTree decomposition is done and result are store in self.blocks as a list containing [x,y,height, width,Std].

To visualize the results, use plot().

plot(edgecolor='red', facecolor='none', linewidth=1)

This function is used to generate a graphical representation of the QuadTree decomposition.

Parameters:
  • edgecolor (string) – color of the rectangles, default is red
  • facecolor (string) – color used for rectangles fills. Default is none.
  • linewidth – width in px of the rectangles’ borders. Default is 1.
Returns:

plot with image and leaves of the quadTree Decomposition

quadTreeDecomposition(img, x, y, minStd, minSize)

This function evaluate the mean and std of an image, and decides Whether to perform or not other 2 splits of the leave.

Parameters:
  • img (numpy.ndarray) – img to analyze
  • x (int) – x offset of the leaves to analyze
  • Y (int) – Y offset of the leaves to analyze
MinStd:

Std threshold for subsequent splitting

MinSize:

Size threshold for subsequent splitting, in pixel