This commit is contained in:
theyatokami 2023-02-19 23:24:19 +01:00
parent 154a832b2a
commit 588c73969d
2 changed files with 9 additions and 11 deletions

15
V2rgb.m
View File

@ -13,6 +13,12 @@
% Loop through the images selected
% Initialize a matrix to store RGB values
all_rgb = zeros(900, 3, 61, 101);
% Initialize iteration
a=0;
for i = 100:1000
% Set the image path
image_path = imread(sprintf('frame2_%d.jpg', i));
@ -23,12 +29,6 @@ for i = 100:1000
imwrite(roi, (sprintf('frames/my_imagev2%d.jpg',i)));
end
% Initialize a matrix to store RGB values
all_rgb = zeros(900, 3, 61, 101);
% Initialize iteration
a=0;
% Loop through 900 images
for i = 100:1000
% Read image
@ -51,6 +51,7 @@ for i = 100:1000
% Display iteration
disp(a);
end
% Compute mean RGB values for each image
mean_rgb = squeeze(mean(mean(all_rgb, 4), 3));
save('mean_rgb.m', 'mean_rgb');
@ -115,7 +116,7 @@ hold off;
xlabel('Frequency (Hz)');
ylabel('Magnitude');
legend('Red', 'Green', 'Blue');
legend({'Red', 'Green', 'Blue'});
% Find indices in f that correspond to the frequency range of interest
idx_range = find(f >= 0.75 & f <= 4);

View File

@ -13,9 +13,6 @@ total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
frame_number = 0
while True:
success, frame = video.read()
if not success:
break
if frame_number % int(frame_rate / 24) == 0:
cv2.imwrite("frame2_{}.jpg".format(frame_number), frame)
frame_number += 1