guibot.imagelogger module


Image logging for enhanced debugging and verbosity of guibot’s operation.


class guibot.imagelogger.ImageLogger[source]

Bases: object

Logger for the image matching process with the help of images.

It always contains the current match case: the needle and haystack images/targets being matched and the hotmap (an image with additional drawn information on it), the matched similarity and the matched coordinates.

Generally, each finder class takes care of its own image logging, performing drawing or similar operations on the spot and deciding which hotmaps (also their names and order) to dump.

step = 1

number of the current step

accumulate_logging = False

switch to stop logging and later on log all accumulated dumps at once

logging_level = 40

level for the image logging

logging_destination = 'imglog'

destination for the image logging in order to dump images (the executing code decides when to clean this directory)

step_width = 3

number of digits for the counter of logged steps


Build an imagelogger object.


Getter for readonly attribute.

Returns:step number prepended with zeroes to obtain a fixed length enumeration
Return type:str

Log images with a DEBUG logging level.


Log images with an INFO logging level.


Log images with a WARNING logging level.


Log images with an ERROR logging level.


Log images with a CRITICAL logging level.


Write file with the current needle and haystack.

The current needle and haystack (matched images) are stored as needle and haystack attributes.

dump_hotmap(name, hotmap)[source]

Write a file the given hotmap.

  • name (str) – filename to use for the image
  • hotmap (PIL.Image or numpy.ndarray) – image (with matching results) to write

Clear all accumulated logging including hotmaps, similarities, and locations.