Python script to calculate the rotation speed of the cell from cell videos.
python3
pip install tqdm seaborn scikit-learn scipy Pillow pandas opencv-python opencv-contrib-python numpy matplotlib
- Get your system ready for the mentioned dependencies.
- Clone this repo.
- Inside the script directory, create a new directory named
dataset
. - Copy the cell videos to analyze into the
dataset
directory. - Execute the main script,
python main.py
.
- Select ROI for analyzing
The selection will be cached into python pickle file namedroi.pkl
, so that you wouldn't need to select the ROI again next time for the same video. Press ENTER to proceed. - Adjust the threshold for the binarization
The optimal threshold gives the most accurate cell area. Press ENTER to proceed. - The processing will be started. The results will be outputted into the directory named
output
.
The output result is a heatmap of pairwise similarity of frame t1
and frame t2
. For example,
From this figure, we can observe some peaks in pairwise similarity at delta=30
and delta=60
. These peaks indicate the rotation cycles. Given that the rotation cycle is 30 (frames)
, fps is 30.0
, we can calculate that the rotation speed is 360 (deg/s)
.