Lightweight camera pipeline for capturing microscope slide images using an Arducam connected to a Raspberry Pi, then automatically cropping the region of interest for downstream analysis.
This project captures an image from an Arducam camera mounted on a microscope and applies basic computer vision to detect the slide area and crop the image automatically. The goal is to reduce manual preprocessing and produce consistent, analysis-ready images.
- Image capture from Arducam on Raspberry Pi
- Automatic slide/ROI detection via contour-based processing
- Cropped output images for analysis or upload
ContourTest1.py
Python script for contour detection and auto-croppingtakePhoto.sh
Shell script to trigger image capture from the camerainstall_pivariety_pkgs.sh
Installs Arducam / Pi camera dependencies
Tested on Raspberry Pi with an Arducam camera.
# Install camera dependencies
bash install_pivariety_pkgs.sh
# (Optional) create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install opencv-python numpy# Capture an image from the camera
bash takePhoto.sh
# Run auto-cropping pipeline
python3 ContourTest1.pyProcessed images are saved locally.
-
Lighting conditions significantly affect contour detection accuracy
-
Camera alignment and focus matter for reliable cropping
-
This is a task-specific pipeline, not a general-purpose vision framework
-
More robust slide edge detection under uneven lighting
-
Batch processing for multiple images
-
Optional cloud upload integration
This repository contains experimental scripts and is intended for prototyping and coursework.