2.1.2.1.6. sf_tools.image.stats module

IMAGE STATISTICS ROUTINES

This module contains methods for the statistical analysis of images.

Author:Samuel Farrens <samuel.farrens@gmail.com>
Version:1.1
Date:20/10/2017
class sf_tools.image.stats.SAT(data)[source]

Summed Area Table

This class produces a Summed Area Table (SAT) for fast and efficient statistics on image patches.

Parameters:data (np.ndarray) – Input 2D data array

Notes

Also know as Itegral Image (i in the class features).

Todo

Add equations and citations

get_area(data, corners)[source]

Get area

This method calculates the area of a patch.

Parameters:
  • data (np.ndarray) – Input 2D data array
  • corners (tuple) – Positions of upper left and bottom right corners.
Returns:

Return type:

float area

get_npx(corners)[source]

Get number of pixels

This method calculates the number of pixels in a patch.

Parameters:corners (tuple) – Positions of upper left and bottom right corners.
Returns:
Return type:int number of pixels
get_var()[source]

Get variance

This method calculates the variance and standard deviation of a patch.

set_patch(corners)[source]

Set patch

This method sets the corner positions of a single patch.

Parameters:corners (tuple) – Positions of upper left and bottom right corners.
set_patches(corners)[source]

Set patches

This method sets the corner positions for multiple patches.

Parameters:corners (list) – List of the positions of upper left and bottom right corners.