Skip to content

Commit 6a96c70

Browse files
committed
Bug fixes
1 parent f0593b9 commit 6a96c70

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
long_description = long_description,
88
long_description_content_type = 'text/markdown',
99
packages = ['splashlab', 'splashlab.dimensional_analysis', 'splashlab.computer_vision'], # Chose the same as "name"
10-
version = 'v0.0.13', # Start with a small number and increase it with every change you make
10+
version = 'v0.0.15', # Start with a small number and increase it with every change you make
1111
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
1212
description = 'A package for fluid mechanic experimentalists', # Give a short description about your library
1313
author = 'Spencer Truman', # Type in your name

splashlab/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
from splashlab.dimensional_analysis.parameter import *
77
from splashlab.dimensional_analysis.unit import *
88
from splashlab.dimensional_analysis.util import *
9-
from splashlab.computer_vision.image_util import *

splashlab/computer_vision/image_util.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ def read_image_folder(folder_path, file_extension='.tif', start=0, end=-1, read_
2525
return images
2626

2727

28+
def read_mp4(video_file):
29+
video = cv2.VideoCapture(video_file)
30+
success = True
31+
frames = []
32+
while success:
33+
success, frame = video.read()
34+
if success:
35+
frames.append(frame)
36+
frames = np.arrays(frames)
37+
return frames
38+
39+
2840
def write_video(output_file, images, framerate=20, color=False, fourcc=cv2.VideoWriter_fourcc(*'mp4v')):
2941
video = cv2.VideoWriter(output_file, fourcc, framerate, (images.shape[2], images.shape[1]), color)
3042
for i in images:
@@ -170,9 +182,6 @@ def feature_tracker(images: np.ndarray, selected_contour: np.ndarray, func=None,
170182

171183

172184
if __name__ == "__main__":
173-
images = np.load('C:/Users/truma/Documents/Code/ComputerVision_ws/data/bird_impact.npy')
174-
print('images loaded', images.shape)
175-
selected = feature_selector(images[500:])
176-
tracked_feature, returned_images = feature_tracker(images[501:700], selected, show_images=False, return_images=True)
177-
print('finished tracking')
178-
animate_images(returned_images, wait_key=True, BGR=False)
185+
test_frames = read_mp4('C:/Users/truma/Downloads/samara_seed.avi')
186+
print(len(test_frames))
187+
animate_images(test_frames)

0 commit comments

Comments
 (0)