Created
October 1, 2022 12:00
-
-
Save jfjensen/da8e4baf73daf8423cc16c5017a260c6 to your computer and use it in GitHub Desktop.
This program is for blacking out the name of my player in the Albion Online screenshots.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 as cv | |
import glob | |
img_src = "screenshots" | |
img_dst = "raw_data" | |
img_paths = glob.glob(img_src + "/*.jpg") | |
index = 0 | |
for img_path in img_paths: | |
print("[INFO] Processing image:", img_path) | |
img = cv.imread(img_path) | |
color = (0,0,0) | |
thickness = -1 | |
cv.rectangle(img, (139,32), (231,54), color=color, thickness=thickness) | |
cv.rectangle(img, (904,312), (1028,356), color=color, thickness=thickness) | |
img_out_path = img_dst + "/{:04d}.jpg".format(index) | |
print(img_out_path) | |
cv.imwrite(img_out_path, img) | |
index += 1 | |
print("[INFO] Done.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment