Medical research instruments
Finding Every Red Blood Cell in an Image
An image-processing routine that locates red blood cells in captured images and reports each cell's center, built for a custom motion and vision system used in medical research.
The problem
A precision instrument maker was building a custom motion and vision system for a medical research program. Part of its job was to find red blood cells in captured images and report exactly where each one was, accurately enough for the rest of the system to rely on.
The images were real-world captures, with uneven contrast, cells cut off at the edges, and cells touching one another, so a single filter would not do.
What we built
A step-by-step detection method. Each image passes through a sequence of stages, each one simple and visible:
- Flip the image’s polarity so the cells stand out from the background.
- Convert it to black and white at a tuned threshold.
- Drop cells cut off by the edge of the image.
- Drop touching or overlapping cells, matching how the client’s original system behaved.
- Fill each cell’s hollow center so it reads as a solid shape.
- Detect the circles, and record each cell’s center in pixels, measured from the center of the image.
Results you can check by eye. The detected centers are drawn over the original image, so the user can see at a glance that each marker sits on a real cell.
Built for tuning. Every stage can be run on its own with its own setting, or the whole method can run at once. Two detection approaches (circle detection and template matching) are available to compare. The routine runs standalone for development, or as one part of the larger system.
We also provided general LabVIEW architecture and hardware support to the client’s team throughout the project.
The result
The system got reliable coordinates for every usable cell in an image, along with a tool that lets the team see and adjust each step when new images or conditions call for it.
- LabVIEW
- NI Vision (IMAQ)
- Blob analysis
- Circle detection
- Template matching