Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ljubicicrobert committed Feb 15, 2022
2 parents ad28e88 + 75bf584 commit 1046a50
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 36 deletions.
4 changes: 2 additions & 2 deletions camera_profiles/DJI Mini 2.cpf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ k2 = -0.110242
k3 = 0.0

[Tangential]
p1 = 0.0016115
p2 = 0.0007491
p1 = 0.0007491
p2 = 0.0016115
2 changes: 1 addition & 1 deletion gui/SSIM Stabilization GUI.application
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>kq1EkxLssxRW1Y5WUlqpyUNaTuuJyy3giJL0kTZ89ac=</dsig:DigestValue>
<dsig:DigestValue>hxGlBCJYMkgl9sUygxpXfqlVuXKex8il0W9vvXCvd6E=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified gui/SSIM Stabilization GUI.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion gui/SSIM Stabilization GUI.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>V+lqCGVH4oo7NnWlj/iLrZULRCODxYaTq6OOH5Lw+Hc=</dsig:DigestValue>
<dsig:DigestValue>0wP6ivnjqlf75H9pZIZvZobDX7Y97201q/U/j7uI/DQ=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
8 changes: 4 additions & 4 deletions gui/update.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Updates]
CurrentReleaseTag = v0.3.0.2
CurrentReleaseName = SSIMS_v0.3.0.2
CurrentReleaseDate = 2022-02-09 18:39:39.244016
LastCheckDate = 2022-02-09 18:39:39.244016
CurrentReleaseTag = v0.3.0.3
CurrentReleaseName = SSIMS_v0.3.0.3
CurrentReleaseDate = 2022-02-15 16:29:51.744473
LastCheckDate = 2022-02-15 16:29:51.744473
DisableUpdateCheck = 0
PauseDays = 0

13 changes: 13 additions & 0 deletions release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
SSIMS_v0.3.0.3

Major changes:
- Fixed bug in Filter form where canceled filter does not properly return to the available filters list

Minor changes:
- Measure distance window now opens in full screen mode
- Added shebang lines for Linux
- Replaced a couple accidental backslashes in path strings
- Fixed DJI Mini 2 tangential distortion coeff's swap

-------------------------------------------------------------------------------

SSIMS_v0.3.0.2

Minor changes:
Expand Down
8 changes: 6 additions & 2 deletions scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import cv2
import numpy as np
import configparser
from argparse import ArgumentParser
from datetime import datetime

__package_name__ = 'SSIMS: Preprocessing tool for UAV image velocimetry'
__description__ = 'Preprocessing and video stabilization tool for UAS/UAV image velocimetry based on Structural Similarity (SSIM) Index metric'
__version__ = '0.3.0.2'
__version__ = '0.3.0.3'
__status__ = 'beta'
__date_deployed__ = '2022-02-09'
__date_deployed__ = '2022-02-15'

__author__ = 'Robert Ljubicic, University of Belgrade - Civil Engineering Faculty'
__author_email__ = '[email protected]'
Expand Down
5 changes: 4 additions & 1 deletion scripts/feature_tracking.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -128,7 +131,7 @@ def xy2str(l):
s = ''
i = 1
for x, y in l:
s += '{}: {}, {}\n'.format(i, x, y)
s += '#{}: X={}, Y={}\n'.format(i, x, y)
i += 1

return s[:-1]
Expand Down
15 changes: 11 additions & 4 deletions scripts/filter_frames.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -21,14 +24,15 @@
from os import path, makedirs
from scipy.signal import gaussian, convolve2d

import inspect
import glob
import matplotlib.pyplot as plt
import mplcursors

except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()

separator = '---'
Expand Down Expand Up @@ -127,7 +131,7 @@ def keypress(event):
parser.add_argument('--multi', type=int, help='Path to filter list file', default=0)
args = parser.parse_args()

img_list = glob.glob(r'{0}\*.{1}'.format(args.folder, args.ext))
img_list = glob.glob(r'{0}/*.{1}'.format(args.folder, args.ext))
num_frames = len(img_list)
filters_data = np.loadtxt(args.folder + '/filters.txt', dtype='str', delimiter=r'/', ndmin=2)
num_filters = filters_data.shape[0]
Expand All @@ -146,7 +150,10 @@ def keypress(event):

legend = 'Filters:'
for i in range(num_filters):
legend += '\n ' + filters_data[i][0] + '/' + filters_data[i][1]
func_args_names = locals()[filters_data[i][0]]
func_args = inspect.getfullargspec(func_args_names)[0][1:] if filters_data[i][1] != '' else []
legend_values = ['{}={}'.format(p, v) for p, v in zip(func_args, filters_data[i][1].split(','))]
legend += '\n ' + filters_data[i][0] + ': ' + ', '.join(legend_values if filters_data[i][1] != '' else '')

legend_toggle = plt.text(0.02, 0.97, legend,
horizontalalignment='left',
Expand Down Expand Up @@ -197,4 +204,4 @@ def keypress(event):
except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
9 changes: 6 additions & 3 deletions scripts/frames_to_video.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +26,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()


Expand Down Expand Up @@ -57,9 +60,9 @@
interp= interp_methods[int(cfg.get(section, 'Interpolation', fallback='0'))])

print('\a')
input('Press any key to exit...')
input('Press ENTER/RETURN to exit...')

except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
14 changes: 12 additions & 2 deletions scripts/image_measure.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -28,7 +31,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()


Expand Down Expand Up @@ -149,9 +152,16 @@ def getMeasurement(event):
fontsize=9,
)

try:
mng = plt.get_current_fig_manager()
mng.window.state('zoomed')
mng.set_window_title('Inspect frames')
except:
pass

plt.show()

except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
15 changes: 9 additions & 6 deletions scripts/inspect_frames.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -27,7 +30,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()

separator = '---'
Expand Down Expand Up @@ -88,19 +91,19 @@ def keypress(event):

if frames_folder is None:
print('\nFrames folder not provided!')
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()
elif ext is None:
print('\nNo frame extension provided!')
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()

frames_list = glob.glob(r'{}\*.{}'.format(frames_folder, ext))
frames_list = glob.glob(r'{}/*.{}'.format(frames_folder, ext))
num_frames = len(frames_list)

if num_frames == 0:
print('\nNo frames were found in folder [{0}] with extension [{1}]'.format(frames_folder, ext))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()

fig, ax = plt.subplots()
Expand Down Expand Up @@ -145,4 +148,4 @@ def keypress(event):
except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
3 changes: 3 additions & 0 deletions scripts/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import setuptools

setuptools.setup(name='SSIMS: Preprocessing tool for UAV image velocimetry',
Expand Down
7 changes: 5 additions & 2 deletions scripts/ssim_scores.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -27,7 +30,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()


Expand Down Expand Up @@ -76,4 +79,4 @@ def keypress(event):
except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
11 changes: 7 additions & 4 deletions scripts/stabilize_frames.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -18,9 +21,9 @@

try:
from __init__ import *
from datetime import timedelta
from shutil import copy, SameFileError
from time import time
from datetime import timedelta
from os import path, listdir, makedirs, remove
from feature_tracking import get_gcps_from_image, fresh_folder
from itertools import product
Expand All @@ -32,7 +35,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()


Expand Down Expand Up @@ -111,7 +114,7 @@ def framesToVideo(output, folder='.', ext='jpg', codec='MJPG', fps=30.00, scale=
if not size_adj:
print('[ERROR] Frame {} does not have the same size as the first frame!\n'
'[ERROR] OpenCV Video writer requires all frames to be the same size!'.format(i))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()
else:
print('[WARNING] Adjusting the size of frame {} to {}x{} px'.format(i, width, height))
Expand Down Expand Up @@ -206,7 +209,7 @@ def coordTransform(image: np.ndarray,

else:
print('[ERROR] Unknown transformation method for stabilization point set!')
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')

if M_ortho is not None:
M_final = np.matmul(M_ortho, M_stable)
Expand Down
11 changes: 7 additions & 4 deletions scripts/unpack_video.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -24,7 +27,7 @@
except Exception as ex:
print('\n[EXCEPTION] Import failed: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()


Expand Down Expand Up @@ -96,7 +99,7 @@ def videoToFrames(video: str, folder='.', frame_prefix='frame', ext='jpg', verbo

if not path.exists(video):
print('[ERROR] Video file not found at {}'.format(video))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')
exit()

vidcap = cv2.VideoCapture(video)
Expand Down Expand Up @@ -216,9 +219,9 @@ def videoToFrames(video: str, folder='.', frame_prefix='frame', ext='jpg', verbo
)

print('\a')
input('Press any key to exit...')
input('Press ENTER/RETURN to exit...')

except Exception as ex:
print('\n[EXCEPTION] The following exception has occurred: \n\n'
' {}'.format(ex))
input('\nPress any key to exit...')
input('\nPress ENTER/RETURN to exit...')

0 comments on commit 1046a50

Please sign in to comment.