pedarProbe.export.FootHeatmap#

class pedarProbe.export.FootHeatmap(node: Type[Node], attr_name: str = 'sensor_peak')[source]#

Bases: object

Foot heatmap class.

Parameters:
  • node – the node that stores the data for generate foot heatmap.

  • attr_name – attribute name, which is a keyword in PedarNode’s attributes dictionary.

Note

Class Attributes

self.l_pedar numpy.ndarray

left foot attribute distribution.

self.r_pedar

left foot attribute distribution.

__init__(node: Type[Node], attr_name: str = 'sensor_peak')[source]#

Methods

__init__(node[, attr_name])

average(*hms)

Return an averaged heatmap object of the inputted heatmap objects.

export_foot_heatmap([range, is_export, ...])

Plot and export the foot heatmap.

fill_foot_heat_map(node[, attr_name])

Fill attribute value to distribution according to cls.l_index and cla.r_index.

load_foot_mask()

Load foot mask, detect the pixel coordinates belonging to 0~198 sensor areas, and store them in cls.l_index and cla.r_index.

Attributes

l_index

dict that stores the pixel coordinates of different left foot sensor areas, which sensor ID 0~98 as the keywords.

r_index

dict that stores the pixel coordinates of different right foot sensor areas, which sensor ID 99~197 as the keywords.

l_index = None#

dict that stores the pixel coordinates of different left foot sensor areas, which sensor ID 0~98 as the keywords. Initialised as None.

r_index = None#

dict that stores the pixel coordinates of different right foot sensor areas, which sensor ID 99~197 as the keywords. Initialised as None.

classmethod load_foot_mask()[source]#

Load foot mask, detect the pixel coordinates belonging to 0~198 sensor areas, and store them in cls.l_index and cla.r_index.

Tip

Every pixel of the left foot mask file config/left_foot_mask.png is labelled by the pedar sensor ID it belongs to. The right foot mask is generated by flipping the left foot mask.

Noted that there are two sensor ID numbering conventions. Please refer to id_map() for more information.

Attention

Being called in the first instantiating of FootHeatmap by __init__().

fill_foot_heat_map(node: Type[Node], attr_name: str = 'sensor_peak')[source]#

Fill attribute value to distribution according to cls.l_index and cla.r_index.

Parameters:
  • node – the node that stores the data for generate foot heatmap.

  • attr_name – attribute name, which is a keyword in PedarNode’s attributes dictionary.

Attention

called by __init__().

export_foot_heatmap(range: Union[str, tuple] = 'static', is_export: bool = True, export_folder: str = 'output', save_suffix: str = '')[source]#

Plot and export the foot heatmap.

Parameters:
  • range

    The color mapping range.

    • 'static': map value \(\in [0, 300]\) to color, suitable for pressure distribution heatmap.

    • 'auto': automatically detect the value range, suitable for other attribute distribution heatmap.

    • manually setting the color mapping range with a tuple in the format of (<min, max>), suitable for generating various heatmap with a unified color mapping range.

    Attention

    Value lower (higher) than the lower (higher) range will be mapped as the lowest (highest) color in the color bar.

  • is_export – export the analysed result as a local file or not.

  • export_folder – the folder of the exported file.

  • save_suffix

    the suffix added to the default export file name foot_heatmap.

    Tip

    A specific suffix can avoid exported file be override by future export.

static average(*hms)[source]#

Return an averaged heatmap object of the inputted heatmap objects.

Parameters:

*hms – inputted heatmap objects for average.