changes to fig_detection_with_layout.py so tables are getting parsed as well reusage of adding external contour in table_parsing.py
27 lines
533 B
Python
27 lines
533 B
Python
import cv2
|
|
from matplotlib import pyplot as plt
|
|
|
|
|
|
def show_mpl(image):
|
|
fig, ax = plt.subplots(1, 1)
|
|
fig.set_size_inches(20, 20)
|
|
ax.imshow(image, cmap="gray")
|
|
plt.show()
|
|
|
|
|
|
def save_mpl(image, path):
|
|
# fig, ax = plt.subplots(1, 1)
|
|
# figure = plt.gcf()
|
|
# figure.set_size_inches(16,12)
|
|
fig, ax = plt.subplots(1, 1)
|
|
fig.set_size_inches(20, 20)
|
|
ax.imshow(image, cmap="gray")
|
|
# plt.close()
|
|
plt.savefig(path)
|
|
plt.close()
|
|
|
|
|
|
def show_cv2(image):
|
|
cv2.imshow("", image)
|
|
cv2.waitKey(0)
|