diff --git a/sbb_newspapers_org_image/eynollah.py b/sbb_newspapers_org_image/eynollah.py index 936e1ef..b9d7735 100644 --- a/sbb_newspapers_org_image/eynollah.py +++ b/sbb_newspapers_org_image/eynollah.py @@ -37,7 +37,6 @@ from .utils.contour import ( find_new_features_of_contoures, get_text_region_boxes_by_given_contours, get_textregion_contours_in_org_image, - return_bonding_box_of_contours, return_contours_of_image, return_contours_of_interested_region, return_contours_of_interested_region_by_min_size, diff --git a/sbb_newspapers_org_image/unused.py b/sbb_newspapers_org_image/unused.py index 199c216..80654d4 100644 --- a/sbb_newspapers_org_image/unused.py +++ b/sbb_newspapers_org_image/unused.py @@ -3048,3 +3048,12 @@ def return_contours_of_interested_region_and_bounding_box(region_pre_p, pixel): boxes.append([int(x), int(y), int(w), int(h)]) return contours_imgs, boxes +def return_bonding_box_of_contours(cnts): + boxes_tot = [] + for i in range(len(cnts)): + x, y, w, h = cv2.boundingRect(cnts[i]) + + box = [x, y, w, h] + boxes_tot.append(box) + return boxes_tot + diff --git a/sbb_newspapers_org_image/utils/contour.py b/sbb_newspapers_org_image/utils/contour.py index 042cab9..a4cc81a 100644 --- a/sbb_newspapers_org_image/utils/contour.py +++ b/sbb_newspapers_org_image/utils/contour.py @@ -216,15 +216,6 @@ def return_contours_of_interested_textline(region_pre_p, pixel): contours_imgs = filter_contours_area_of_image_tables(thresh, contours_imgs, hiearchy, max_area=1, min_area=0.000000003) return contours_imgs -def return_bonding_box_of_contours(cnts): - boxes_tot = [] - for i in range(len(cnts)): - x, y, w, h = cv2.boundingRect(cnts[i]) - - box = [x, y, w, h] - boxes_tot.append(box) - return boxes_tot - def return_contours_of_image(image): if len(image.shape) == 2: