refactoring
This commit is contained in:
parent
e8863d67aa
commit
9d30009dce
@ -7,7 +7,7 @@ from vidocp.utils import (
|
|||||||
draw_rectangles,
|
draw_rectangles,
|
||||||
remove_included,
|
remove_included,
|
||||||
remove_primary_text_regions,
|
remove_primary_text_regions,
|
||||||
__detect_large_coherent_structures,
|
detect_large_coherent_structures,
|
||||||
is_large_enough,
|
is_large_enough,
|
||||||
has_acceptable_format,
|
has_acceptable_format,
|
||||||
)
|
)
|
||||||
@ -22,7 +22,7 @@ def detect_figures(image: np.array):
|
|||||||
image = image.copy()
|
image = image.copy()
|
||||||
|
|
||||||
image = remove_primary_text_regions(image)
|
image = remove_primary_text_regions(image)
|
||||||
cnts = __detect_large_coherent_structures(image)
|
cnts = detect_large_coherent_structures(image)
|
||||||
|
|
||||||
cnts = filter(is_likely_figure, cnts)
|
cnts = filter(is_likely_figure, cnts)
|
||||||
rects = map(cv2.boundingRect, cnts)
|
rects = map(cv2.boundingRect, cnts)
|
||||||
|
|||||||
1
vidocp/utils/__init__.py
Normal file
1
vidocp/utils/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from .utils import *
|
||||||
@ -200,7 +200,7 @@ def remove_primary_text_regions(image):
|
|||||||
return image
|
return image
|
||||||
|
|
||||||
|
|
||||||
def __detect_large_coherent_structures(image: np.array):
|
def detect_large_coherent_structures(image: np.array):
|
||||||
"""Detects large coherent structures on an image.
|
"""Detects large coherent structures on an image.
|
||||||
|
|
||||||
References:
|
References:
|
||||||
Loading…
x
Reference in New Issue
Block a user