Skip to content

Commit

Permalink
fix accented filenames cv2 error
Browse files Browse the repository at this point in the history
  • Loading branch information
vncs1880 committed May 9, 2024
1 parent 35af643 commit feede9e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion auto_stack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import shutil

import cv2
import numpy as np
import time
Expand Down Expand Up @@ -111,7 +113,7 @@ def stackImagesKeypointMatching(file_list, save_intermediates=True):
import PySimpleGUI as sg

file_list = sg.popup_get_file('', file_types=(('imgs', '.jpg .png .bmp'),), multiple_files=True, no_window=True, keep_on_top=True)
method = 'ECC'
method = 'ECC' if sg.popup_yes_no('ECC? (Slower but more accurate)', keep_on_top=True, auto_close=True, auto_close_duration=5) == 'Yes' else 'ORB'
# import time
output_image = strftime("%Y-%m-%d %H.%M.%S") + '.jpg'
show = True if sg.popup_yes_no('display img?', keep_on_top=True, auto_close=True, auto_close_duration=5) == 'Yes' else False
Expand Down Expand Up @@ -140,6 +142,14 @@ def stackImagesKeypointMatching(file_list, save_intermediates=True):
output_image = args.output_image
show = args.show

file_list2 = []
import unidecode
for idx, file in enumerate(file_list):
if file != unidecode.unidecode(file):
shutil.copy(file, unidecode.unidecode(file))
file_list2.append(unidecode.unidecode(file))
file_list = file_list2

tic = time()

if method == 'ECC':
Expand Down

0 comments on commit feede9e

Please sign in to comment.