Tracking and Feature Analysis of Bio Cells

This project segments cells in time-series microscopy images, tracks each cell across frames with the TrackCells algorithm, and outputs trajectories, speed, morphology, and texture features for downstream analysis.

Labeled segmented cells selected for tracking
Selected cells highlighted in the first frame — the starting point for tracking.

Methodology

From raw microscopy to interpretable trajectories

The pipeline stays short and explicit: turn each image into measurable cell objects, then connect the same cell across frames using a distance gate plus an area-change rule.

01

Pre-process

Read each frame, convert to greyscale, and separate foreground from background with an Otsu threshold.

02

Segment

Clean the binary mask with opening, closing, and hole-filling, then label connected cell regions.

03

Select

Filter labels by area range and distance from the image border, picking 15 cells in the first frame for tracking.

04

Track

For each cell, find nearby candidates in the next frame and use area change to classify normal motion, division, or anomaly.

Algorithm 1

TrackCells core pseudocode

The tiered matching scheme — gating by distance, accepting normal movement, detecting division by paired-area, and falling back on the largest candidate for fusion — is my own design, captured here as Algorithm 1 in the project report. Lines highlight as the demo animation steps through Measure → Gate → Verify → Write.

  1. function TrackCells(frames, trackedIds, maxDist, areaChangeThresh)
  2. // Block 1: initial measurement
  3. meas0 ← measure features on frames[0]
  4. for all id in trackedIds do
  5. record meas0[id] as prevFeat[id]; append center to trackedCenters[id]
  6. end for
  7. // Block 2: tiered matching across frames
  8. for all frame in frames[1:] do
  9. meas ← measure features on frame
  10. for all id in trackedIds do
  11. candidates ← find all objects within maxDist of prevFeat[id]
  12. if candidates not empty then
  13. select nearest candidate
  14. if size change ≤ areaChangeThresh then
  15. // normal tracking
  16. assign candidate to id
  17. else if sum of two nearest candidates' sizes ≈ prev size then
  18. // division detected
  19. assign larger daughter cell to id
  20. else
  21. // fusion detected
  22. assign largest candidate to id
  23. end if
  24. else
  25. maintain previous center for id
  26. end if
  27. end for
  28. end for
  29. return trackedCenters, trackedMasks, trackedIds
  30. end function

Interactive demo

Cross-frame matching, step by step

The animation breaks each TrackCells decision into four readable stages: measure, gate candidates by distance, verify by area change, then write the trajectory.

Results

Tracked cells across the full sequence

Three figures from the project report: first-frame segmentation with selected cells, and per-group trajectories over 30 frames.

Methodology & attribution

Algorithm and acknowledgements

Algorithm authorship. The tiered cross-frame matching scheme presented in Algorithm 1 — gating by distance, accepting normal movement, detecting cell division by paired-area sum, and falling back to the largest candidate for fusion — is my own design and contribution to this project. The pseudocode on this page is a faithful transcription of Algorithm 1 in the project report.

Foundations the approach builds on. Cell segmentation and per-frame feature extraction follow standard image-processing practice (connected-component labelling, region morphometrics). For surveys of cell-tracking strategies the work was informed by general computer-vision and biomedical-image-analysis literature on object tracking and lineage reconstruction.