dawsonia.viz#

Module Contents#

Functions#

debug_image

debug_threshold

debug_tables_detected

debug_table_positions

plot image for debug Parameters

make_patch_collection_from_bboxes

debug_image_table_detect_opencv_contours

_get_bbox_extent

debug_clustered_bboxes

Data#

DAWSONIA_DEBUG

DAWSONIA_DEBUG_TABLE_DETECT

logger

API#

dawsonia.viz.DAWSONIA_DEBUG#

‘getenv(…)’

dawsonia.viz.DAWSONIA_DEBUG_TABLE_DETECT#

‘getenv(…)’

dawsonia.viz.logger#

‘getLogger(…)’

dawsonia.viz.debug_image(im: numpy.typing.NDArray, title: str = '', gray=True)#
dawsonia.viz.debug_threshold(image: numpy.typing.NDArray, title: str = 'debug_threshold')#
dawsonia.viz.debug_tables_detected(image: numpy.typing.NDArray, label_image: numpy.typing.NDArray[numpy.int64], min_area: int)#
dawsonia.viz.debug_table_positions(image_filter, pos_list, size_list, label_tables=None, printer=False, override_debug_mode=False)#

plot image for debug Parameters

image_filter : array 2D grey image of a page without background noise pos_list : list Each element of this list is a list containing the informations of each box of a table. The format of the information is::

   [
        vertical position [int],
        horizontal position [int],
        width [int],
        height [int]
   ]

the position is defined in relation to the position on the whole page
and not in relation to the relative position of the table

size_list : list list of the size of tables

dawsonia.viz.make_patch_collection_from_bboxes(bboxes, facecolor: str | numpy.typing.NDArray[numpy.float64] = 'r') matplotlib.collections.PatchCollection#
dawsonia.viz.debug_image_table_detect_opencv_contours(filtered_image, thresh_value, dilated_value, original_image, bboxes)#
dawsonia.viz._get_bbox_extent(bboxes: collections.abc.Sequence[dawsonia.typing.BBoxTuple]) tuple[float, tuple[slice, slice]]#
dawsonia.viz.debug_clustered_bboxes(ref_image: numpy.typing.NDArray, bboxes: collections.abc.Sequence[dawsonia.typing.BBoxTuple], sorted_cluster_bboxes: dict[dawsonia.typing.ClusterLabel, collections.abc.Iterable[int] | numpy.typing.NDArray[numpy.int64]]) None#