Skip to content
Snippets Groups Projects
Commit b3446797 authored by LexvanGastel's avatar LexvanGastel
Browse files

vraag 18

parent 7e98fb2d
Branches feature/image_processor feature/plotter
No related tags found
No related merge requests found
class ImageProcessor:
def __init__(self, image_path):
self.image
self.image_rgb
self.image_hsv
def apply_median_filter(self, kernel_size):
return filterd_image
def get_color_channels(self):
return red_channel, green_channel, blue_channel
def convert_to_hsv(self):
return hsv_image
class Plotter:
def __init__(self):
pass
def plot_image_channels(self, image):
return None
def plot_histograms(self, image):
return None
\ No newline at end of file
import scipy.io
import numpy as np
from scipy.signal import butter, filtfilt
from scipy.signal import butter, filtfilt, find_peaks
import matplotlib.pyplot as plt
def load_emg_data(file_path):
......@@ -130,6 +130,25 @@ def plot_emg_data(file_path):
freq_rf, fft_rf = compute_fft(envelope_rf, sampling_rate)
freq_ta, fft_ta = compute_fft(envelope_ta, sampling_rate)
peaks_rf, _ = find_peaks(envelope_rf)
peaks_ta, _ = find_peaks(envelope_ta)
num_peaks_rf = len(peaks_rf)
num_peaks_ta = len(peaks_ta)
max_value_rf = np.max(envelope_rf)
max_value_ta = np.max(envelope_ta)
area_rf = np.trapz(envelope_rf, time_vector)
area_ta = np.trapz(envelope_ta, time_vector)
print(f"1.Numbers of EMG peaks Rectus Femoris: {num_peaks_rf}")
print(f"1.Numbers of EMG peaks Tibialis Anterior: {num_peaks_ta}")
print(f"2. Maximale peak Rectus Femoris: {max_value_rf}")
print(f"2. Maximale peak Tibialis Anterior: {max_value_ta}")
print(f"3. Area under Curve Rectus Femoris {area_rf}")
print(f"3. Area under Curve Tibialis Anterior {area_ta}")
plt.figure(figsize=(13,8))
plt.subplot(2, 2, 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment