From: will Date: Mon, 26 Aug 2024 21:24:29 +0000 (+0100) Subject: Resolution and waitKey changes X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=f8a548e8ccbaba69815b152b56a2d8d102861c53;p=audio-over-stft Resolution and waitKey changes --- diff --git a/.gitignore b/.gitignore index 2bdcf07..772d3f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.npy *.jpg *.wav -__pycache__* +./__pycache__ diff --git a/camera.py b/camera.py index 64c77d2..f4259f9 100644 --- a/camera.py +++ b/camera.py @@ -74,7 +74,7 @@ class camera(): self.last_capture = None self.last_recovered = None - cv.namedWindow("display", cv.WINDOW_NORMAL) + cv.namedWindow("display", cv.WINDOW_NORMAL + cv.WINDOW_GUI_NORMAL) if self.show_debug == True: cv.namedWindow("debug", cv.WINDOW_NORMAL) @@ -118,7 +118,7 @@ class camera(): print("calibration failed") quit() - if self.use_file == True: + if self.use_files == True: self.get_lookup() def get_lookup( @@ -209,4 +209,3 @@ class camera(): return image - diff --git a/data/test.jpg b/data/test.jpg deleted file mode 100644 index c70a992..0000000 Binary files a/data/test.jpg and /dev/null differ diff --git a/data/test1.png b/data/test1.png deleted file mode 100644 index 24cb6bf..0000000 Binary files a/data/test1.png and /dev/null differ diff --git a/fft.py b/fft.py index 1685134..45af6c4 100644 --- a/fft.py +++ b/fft.py @@ -3,6 +3,7 @@ import math import time import cv2 as cv import matplotlib.pyplot as plt +import cProfile """ Notes: @@ -107,3 +108,8 @@ class fft(): return data +if __name__ == "__main__": + with cProfile.Profile() as pr: + fft = fft(130, 65) + fft.istft(fft.stft(np.random.randint(-32768, 32767, (130,)))) + pr.print_stats() diff --git a/lookup_color.npy b/lookup_color.npy deleted file mode 100644 index 7f04a4e..0000000 Binary files a/lookup_color.npy and /dev/null differ diff --git a/lookup_vingette.npy b/lookup_vingette.npy deleted file mode 100644 index 4f36d72..0000000 Binary files a/lookup_vingette.npy and /dev/null differ diff --git a/loop.py b/loop.py index 865078c..0e6acda 100644 --- a/loop.py +++ b/loop.py @@ -37,7 +37,7 @@ hop_size = window_size // 2 camera = camera( window_size, window_height, - (1840, 1000), + (1920, 1080), device_id = 2, debug = False, dummy = True, @@ -110,8 +110,8 @@ try: slept = 0 time.sleep(0.1) - while len(audio) > 5 * segment_samples: - time.sleep(0.01) + while len(audio) > 1 * segment_samples: + cv.waitKey(1) slept += 1 print(f"slept {slept} times")