This post contains all the code (or links to code/programs) that you will need for BOS processing. This post accompanies my YouTube video on the subject, which I recommend you watch. If you would rather read, I have a comprehensive PDF document on the topic as well (see below). If you’re more of a GitHub person, all the downloadable files (except the PDF) seen below are also available on my GitHub.
As far as the free programs that you will need for this project, here is a comprehensive list of all those that I mention. Clicking on the links will open the webpages in a new window.
- youtube-dl
- FFmpeg
- ImageJ/Fiji
- Anaconda (which includes Spyder)
- Python (download the latest version)
- Python normxcorr2 function (by GitHub user Sabrewarrior)
For all other programs, see the download buttons below.
Make sure to also download the FIG file. To run the program, open and run this file (M file).
Make sure to place this FIG file in the same directory as the M file. To run the GUI, open and run the M file.
Add this ImageJ/Fiji macro to the “macros” folder. For me, this is located in “Fiji.app > macros”. Then, to make it visible, press Plugins > Macros > Install, and double click on the file. You will then see it when you press Plugins > Macros. This is the most up-to-date version of this macro.
This macro is outdated. Please use BOS_Save_Sequence_v2.ijm
Make sure you have also downloaded the “normxcorr2.py” file mentioned above in the list.
Note: I can’t upload “.py” files, so this is a “.txt” file. Just download it and change the extension to “.py”, and it should work fine.
This is the comprehensive PDF document to accompany my video.
Josh,
Pardon me, I forgot to add the .avi on the end of the new file name! This is why we shouldn’t watch youtube at night time! haha
I appreciate the content, have you considered doing this for the purpose of collecting audio through micro-vibrations picked up in minute pixel variation?
Hi Josh,
I was wondering if you could help me with my query:
I have downloaded FFmpeg and ffmpeg.exe is in my program files folder, the same as my Path. When I execute the command window line, it creates a new file, but the file has no format whatsoever.
any help would be appreciated 🙂
Python script worked one time, but next iterations were not successull
Exception in Tkinter callback
Traceback (most recent call last):
File “C:\Users\epotapov\Anaconda3\lib\tkinter\__init__.py”, line 1883, in __call__
return self.func(*args)
File “C:\Users\epotapov\Documents\MyDocuments\Schliren\GUI_BOS_v6.py”, line 718, in pushPlot
quivU[abs(quivU) > thresh] = np.nan # Apply min/max value threshold to U-displacement
TypeError: bad operand type for abs(): ‘NoneType’
Hello Josh,
I tried to download and run the ffmpeg from about four different sites now with the same result, when I type the conversion command as you showed in the video I always get this or similar error ” ‘ffmpeg’ is not recognized as an internal or external command,
operable program or batch file.” Do you have an idea what to do with it? I tried converting the video differently but then the image j put up an error message saying that the file has “unsupported compression (some numbers) HM (more numbers)”
I don´t know what to do to fix this. Can you help me?
This error is probably because you haven’t added ffmpeg to your computer’s PATH. If you add the ffmpeg executable to your PATH, then it should work from any directory. If you want to check that this is the problem, you can navigate to the folder where ffmpeg is installed and trying running it from there. If that works, then the solution is just to add that directory to the PATH.
Dear Josh.
Never mind, I have found the correct link. Thanks again 🙂
No, you were right. There was an error that I thought I had fixed with Python file uploading, but apparently I hadn’t. Thanks for pointing that out. I’m still going to have to upload .txt files instead of .py files, but at least they will open when downloaded. I’m guessing you found the code on my GitHub, but now the download links on my website should work too. Thanks again!
Hello Josh. Thank you for the great post.
However, I cannot download GUI_BOS_v6.py file. It seems the link is inactive. May you fix the link please? Thank you.