pedarProbe.export.FootHeatmap#
- class pedarProbe.export.FootHeatmap(node: Type[Node], attr_name: str = 'sensor_peak')[source]#
Bases:
objectFoot heatmap class.
- Parameters:
node – the node that stores the data for generate foot heatmap.
attr_name – attribute name, which is a keyword in
PedarNode’sattributesdictionary.
Note
Class Attributes
- self.l_pedar
numpy.ndarray left foot attribute distribution.
- self.r_pedar
left foot attribute distribution.
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_indexandcla.r_index.Load foot mask, detect the pixel coordinates belonging to 0~198 sensor areas, and store them in
cls.l_indexandcla.r_index.Attributes
dictthat stores the pixel coordinates of different left foot sensor areas, which sensor ID 0~98 as the keywords.dictthat stores the pixel coordinates of different right foot sensor areas, which sensor ID 99~197 as the keywords.- l_index = None#
dictthat stores the pixel coordinates of different left foot sensor areas, which sensor ID 0~98 as the keywords. Initialised asNone.
- r_index = None#
dictthat stores the pixel coordinates of different right foot sensor areas, which sensor ID 99~197 as the keywords. Initialised asNone.
- classmethod load_foot_mask()[source]#
Load foot mask, detect the pixel coordinates belonging to 0~198 sensor areas, and store them in
cls.l_indexandcla.r_index.Tip
Every pixel of the left foot mask file
config/left_foot_mask.pngis 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
FootHeatmapby__init__().
- fill_foot_heat_map(node: Type[Node], attr_name: str = 'sensor_peak')[source]#
Fill attribute value to distribution according to
cls.l_indexandcla.r_index.- Parameters:
node – the node that stores the data for generate foot heatmap.
attr_name – attribute name, which is a keyword in
PedarNode’sattributesdictionary.
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
tuplein 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.