]> OzVa Git service - audio-over-stft/commitdiff
Resolution and waitKey changes
authorwill <greenwoodw50@gmail.com>
Mon, 26 Aug 2024 21:24:29 +0000 (22:24 +0100)
committerwill <greenwoodw50@gmail.com>
Mon, 26 Aug 2024 21:24:29 +0000 (22:24 +0100)
.gitignore
camera.py
data/test.jpg [deleted file]
data/test1.png [deleted file]
fft.py
lookup_color.npy [deleted file]
lookup_vingette.npy [deleted file]
loop.py

index 2bdcf07c978f079cc1058799bb9ac95449ae9812..772d3f0c50a6628cb6212b89af19f501bf66db0f 100644 (file)
@@ -1,4 +1,4 @@
 *.npy
 *.jpg
 *.wav
-__pycache__*
+./__pycache__
index 64c77d2f761f7ed661b9a47b9bd54d52e5edcaee..f4259f988eba60b2f313ca7a18669a723cb5438a 100644 (file)
--- 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 (file)
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 (file)
index 24cb6bf..0000000
Binary files a/data/test1.png and /dev/null differ
diff --git a/fft.py b/fft.py
index 168513441a432e444d3b5b8893ea0343b2f8e64b..45af6c4a82c71eae5644c278b32838a344463083 100644 (file)
--- 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 (file)
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 (file)
index 4f36d72..0000000
Binary files a/lookup_vingette.npy and /dev/null differ
diff --git a/loop.py b/loop.py
index 865078ca09d46f74d34aeb24c5ca208c4ca4c851..0e6acdade1dd2d542358a7966c1a4fe407c2a683 100644 (file)
--- 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")