more improvements
This commit is contained in:
+6
-1
@@ -6,6 +6,9 @@ import cv2
|
||||
import os
|
||||
import glob
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def ocr_file(filename):
|
||||
# load the example image and convert it to grayscale
|
||||
image = cv2.imread(filename)
|
||||
@@ -95,6 +98,8 @@ def search_image(file_name):
|
||||
|
||||
edit_path = "{}/test/".format(path)
|
||||
|
||||
Path(edit_path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
print(edit_path)
|
||||
fn1, fn2 = fn.rsplit(".", 1)
|
||||
cv2.imwrite("{}{}_new.{}".format(edit_path, fn1, fn2), img)
|
||||
@@ -126,7 +131,7 @@ image_list = []
|
||||
|
||||
file_types = ("gif", "jpg", "jpeg", "png")
|
||||
for file_type in file_types:
|
||||
for filename in glob.glob('/Users/ross/media/test/*.{}'.format(file_type)): #assuming gif
|
||||
for filename in glob.glob('/home/ross/scripts/sites/backups/New/media/rapids/*.{}'.format(file_type)): #assuming gif
|
||||
image_list.append(filename)
|
||||
|
||||
for f in image_list:
|
||||
|
||||
Reference in New Issue
Block a user