OpenCV-based analysis script for measuring vortex ring diameter over time from image sequences.
Developed for IISc internship workflow experiments.
File: vortex_tracker.py
- Loads image frames from a folder
- Converts each frame to grayscale and blurred image
- Applies fixed binary thresholding
- Finds largest contour as vortex region
- Measures vertical diameter from topmost to bottommost contour points
- Converts pixels to centimeters using calibration constant
- Logs per-frame diameter measurements
- Plots diameter vs time (assuming fixed 500 FPS)
Current constant:
PIXELS_PER_CM = 566 / 2.5
Before running, set these paths in the script:
folder_path- input image directoryproject_folder- output/log directory
vortex_diameters_log.txtvortex_Diameter_changes.png- optional append from
Diameter_of_vortex.txtif present
The repo also includes sample assets/logs:
- frame images under
vortex_images/ - historical speed and diameter logs
- generated diameter plots
python vortex_tracker.pypip install opencv-python numpy matplotlib- Uses fixed thresholding tuned to specific capture conditions
- Assumes largest contour is always the vortex boundary
- Time axis assumes 500 FPS; adjust if your capture rate differs
- Requires manual path setup in script before execution