# {py:mod}`dawsonia.table_detect.opencv_contours` ```{py:module} dawsonia.table_detect.opencv_contours ``` ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours :allowtitles: ``` ## Module Contents ### Functions ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`table_detect_opencv_contours ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.table_detect_opencv_contours :summary: ``` * - {py:obj}`get_table_structure ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.get_table_structure :summary: ``` * - {py:obj}`create_bbox_array ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.create_bbox_array :summary: ``` * - {py:obj}`set_nan_to_odd_bboxes ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.set_nan_to_odd_bboxes :summary: ``` * - {py:obj}`fix_missing_bboxes ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.fix_missing_bboxes :summary: ``` * - {py:obj}`page_curvature_along_x_quad ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.page_curvature_along_x_quad :summary: ``` * - {py:obj}`page_curvature_along_x_cubic ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.page_curvature_along_x_cubic :summary: ``` * - {py:obj}`bboxes_from_contours ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.bboxes_from_contours :summary: ``` * - {py:obj}`cluster_axis ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.cluster_axis :summary: ``` ```` ### Data ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`logger ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.logger :summary: ``` * - {py:obj}`__all__ ` - ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.__all__ :summary: ``` ```` ### API ````{py:data} logger :canonical: dawsonia.table_detect.opencv_contours.logger :value: > 'getLogger(...)' ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.logger ``` ```` ````{py:data} __all__ :canonical: dawsonia.table_detect.opencv_contours.__all__ :value: > ('table_detect_opencv_contours', 'get_table_structure', 'cluster_axis', 'create_bbox_array', 'set_na... ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.__all__ ``` ```` ````{py:function} table_detect_opencv_contours(filtered_image: numpy.typing.NDArray, thresh_value: numpy.typing.NDArray, binary_tables: numpy.typing.NDArray[numpy.bool_], table_fmt, preproc_cfg: dawsonia.typing.PreprocConfig, original_image: numpy.typing.NDArray) -> tuple[dawsonia.typing.TablePositions, dawsonia.typing.TableSizes, int] :canonical: dawsonia.table_detect.opencv_contours.table_detect_opencv_contours ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.table_detect_opencv_contours ``` ```` ````{py:function} get_table_structure(table_fmt, preproc_cfg: dawsonia.typing.PreprocConfig, filtered_image: numpy.typing.NDArray, filtered_image_inv: numpy.typing.NDArray, thresh_value: numpy.typing.NDArray, original_image: numpy.typing.NDArray, label_tables: numpy.typing.NDArray[numpy.int64], nb_labels: int, min_nb_pixels: int, sensibility: float, list_sizes: dawsonia.typing.TableSizes, list_positions: dawsonia.typing.TablePositions) -> None :canonical: dawsonia.table_detect.opencv_contours.get_table_structure ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.get_table_structure ``` ```` ````{py:function} create_bbox_array(bboxes: list[dawsonia.typing.BBoxTuple], column_labels: numpy.typing.NDArray[numpy.int64], column_bboxes_idxs: dict[dawsonia.typing.ClusterLabel, numpy.typing.NDArray[numpy.int64]], row_labels: numpy.typing.NDArray[numpy.int64], row_bboxes_idxs: dict[dawsonia.typing.ClusterLabel, numpy.typing.NDArray[numpy.int64]]) :canonical: dawsonia.table_detect.opencv_contours.create_bbox_array ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.create_bbox_array ``` ```` ````{py:function} set_nan_to_odd_bboxes(all_bboxes) :canonical: dawsonia.table_detect.opencv_contours.set_nan_to_odd_bboxes ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.set_nan_to_odd_bboxes ``` ```` ````{py:function} fix_missing_bboxes(all_bboxes) :canonical: dawsonia.table_detect.opencv_contours.fix_missing_bboxes ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.fix_missing_bboxes ``` ```` ````{py:function} page_curvature_along_x_quad(xs, y_median, a0, a1, a2) :canonical: dawsonia.table_detect.opencv_contours.page_curvature_along_x_quad ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.page_curvature_along_x_quad ``` ```` ````{py:function} page_curvature_along_x_cubic(xs, y_median, a0, a1, a2, a3) :canonical: dawsonia.table_detect.opencv_contours.page_curvature_along_x_cubic ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.page_curvature_along_x_cubic ``` ```` ````{py:function} bboxes_from_contours(contours, area_range=(300, 10000), aspect_ratio_range=(0.05, 20)) :canonical: dawsonia.table_detect.opencv_contours.bboxes_from_contours ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.bboxes_from_contours ``` ```` ````{py:function} cluster_axis(ref_image: numpy.typing.NDArray, bboxes: collections.abc.Sequence[dawsonia.typing.BBoxTuple], axis: typing.Literal[0, 1] = 0, distance_threshold: float | None = None, min_cluster_size: int = 0) -> tuple[numpy.typing.NDArray[numpy.int64], dict[dawsonia.typing.ClusterLabel, numpy.typing.NDArray[numpy.int64]]] :canonical: dawsonia.table_detect.opencv_contours.cluster_axis ```{autodoc2-docstring} dawsonia.table_detect.opencv_contours.cluster_axis ``` ````