-
Crop the video to the target area (in the future, could potentially use a neural net to auto focus)
-
Place video in EVM_Matlab/data
-
In matlab, navigate to the EVM_matlab folder
-
(one time) Install: MATLAB support for MinGW-w64 C/C++ Compiler, image proc toolbox and signal proc toolbox
-
In reproduceResults.m: inFile = fullfile(dataDir,'YOUR_VIDEO.mp4'); fprintf('Processing %s\n', inFile); amplify_spatial_lpyr_temporal_butter(inFile, resultsDir, 60, 90, 3.6, 6.2, 30, 0.3); amplify_spatial_lpyr_temporal_iir(inFile, resultsDir, 10, 16, 0.4, 0.05, 0.1);
-
Run make.m, install.m, then reproduceResults.m
-
Processed videos found in EVM_Matlab/ResultsSIGGRAPH2012
-
Move the video to a new folder
-
Run the command "ffmpeg -i YOUR_PROC_VIDEO.mp4 $filename%03d.bmp"
-
pil_python.py script: change number_of_frames to amount of frames produced by ffmpeg command first part gathers luminence values second part:
Average brightness for the film: ''' plt.plot(x_vals, avgs) plt.xlabel("Time (s)") plt.ylabel("Brightness") plt.title("Average brightness for 30 sec of child eye film") plt.show() plt.close()
Only plots when diff between max and min brightness in a certain range video_lengthwise = [] for x in range(0, width): for y in range(0, height): holder = [] for inner_array in video: holder.append(inner_array[x,y]) maximum = np.max(holder) minimum = np.min(holder) print(abs(maximum - minimum)) if abs(maximum - minimum) > 220: #### change to the range you want video_lengthwise.append(holder) '''
Heatmap portion:
hm = np.zeros(shape=(height, width)) for x in range(0, width): for y in range(0, height): holder = [] for inner_array in video: holder.append(inner_array[y,x]) hm[y,x] = abs(np.max(holder)-np.min(holder))
sns.heatmap(hm) plt.title("Max/min difference heatmap own wrist area") plt.show() #plt.imshow(hm, cmap='hot', interpolation='nearest') #plt.show()
#print(len(video_lengthwise))
''' for i in video_lengthwise: plt.plot(x_vals, i) plt.xlabel("Time (s)") plt.ylabel("Brightness") plt.title("Per pixel brightness (|max - min| > 220)") plt.show()
'''