mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-02-15 20:34:45 +08:00
15 lines
374 B
Python
15 lines
374 B
Python
import matplotlib.pyplot as plt
|
|
import matplotlib.patches as patches
|
|
import numpy as np
|
|
import cv2
|
|
|
|
|
|
img = plt.imread('../example/fill-anything/sample1.png')
|
|
fig, ax = plt.subplots(1)
|
|
ax.imshow(img)
|
|
|
|
x1, y1, x2, y2 = 230, 283, 352, 407
|
|
rect = patches.Rectangle((x1, y1), x2-x1, y2-y1, linewidth=2, edgecolor='r', facecolor='none')
|
|
ax.add_patch(rect)
|
|
plt.savefig('bbox.png')
|