Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

PiCrawler / Camera & Vision

Camera & Vision

Vilib lifecycle, color, QR, face detection and conditional model paths.

Camera and vision: what is implemented and what is conditional

The official kit camera page specifies a 5 MP OV5647 CSI module with fixed focus. It lists 2592×1944 still capture, several video modes and a 65-degree viewing angle. Those are documented product-family specifications; the exact installed sensor, lens and effective modes need a marking photograph and camera enumeration. The user has a front-facing camera, not a verified present-day capture session. The camera does not record microphone audio.

Pi 5's smaller camera connectors require the appropriate ribbon/adapter for the module. Cable contact direction and connector choice matter. Power must be off for ribbon changes. A camera ribbon that appears inserted can still be reversed, incompletely latched or damaged. The recovery procedure uses rpicam-hello --list-cameras or the installed predecessor command only after state capture, rather than changing overlays first.

The actual processing stack

The inspected Vilib source is version 0.3.20. It uses Picamera2/libcamera, OpenCV, NumPy, PIL and a Flask streaming service. Vilib.picam2 = Picamera2() is evaluated at class definition, so importing Vilib is already more than reading package metadata. Camera activity and helper processes may initialize before an explicit camera-start call. Initial forensics should inspect metadata and files, not casually import every installed package.

camera_start() starts a thread and waits until camera_run becomes true. The camera thread requests RGB888 frames, defaults to 640×480 and asks for a 60 fps control setting. That is a request, not a measured processing rate. The thread processes selected detection paths sequentially, updates the latest image and optionally displays locally. Running several models can lower throughput; timing should be measured at the full application level.

If startup fails in the camera thread before the flag is set, the caller's readiness wait has no timeout in the pinned source. This can look like a frozen program. A future wrapper should bound camera initialization and report the actual exception. Restarting the camera in the same process also needs testing because camera_close() closes the class-level Picamera2 object without establishing a fresh object in camera_start().

Capability distinctions

FeaturePinned implementationQualification
Live capture, photo and video recordingVilib coreCamera, codecs/storage and permissions required
MJPEG web previewFlask core, port 9000Network and active camera; no authentication layer established
Color detectionHSV thresholds and contoursLighting-dependent color blobs, not semantic object recognition
Face detectionOpenCV cascadeDetects faces; does not identify people
QR/barcode readingpyzbar/libzbar pathDecodes a code in an image; not waypoint localization by itself
Traffic-sign detectionModel-dependent moduleModel/label files and compatible runtime required
Image classificationTFLite-based pathGlobal image label; not an obstacle position
Object detectionTFLite model/labelsModel, labels, interpreter and selected threshold required
Hand landmarksMediaPipe pathhands_detect_switch; gesture interpretation is extra logic
Body pose landmarksMediaPipe pathHuman pose estimation, not the crawler's body orientation
Face recognitionNot established as a current identity APIHistorical face-recognition dependency was abandoned
gesture_detect_switchReferenced by current control documentation but absent in inspected coreDo not advertise it as a working API

The installer supplies model/cascade assets in /opt/vilib, outside the Python module directory. A repository clone or pip metadata record alone does not establish those assets. A model has its own provenance and redistribution conditions; the package license does not automatically describe every model's origin. Record asset hashes before migration and avoid inventing trained-model performance.

Python 3.13 is a real boundary

The pinned installer explicitly skips MediaPipe unless the system is 64-bit and Python is older than 3.13. It also skips tflite-runtime on Python 3.13 or newer. Basic camera, color, face and QR paths can still have different dependency conditions, but the installation's general success does not prove hand/pose/object/classification features. The historical Python 3.13 evidence therefore matters. It is not proof of current installed availability.

The October 2026 changelog records a NumPy fix: Bookworm-and-older installations pin NumPy 1.26.4 to avoid shadowing the system NumPy 1.x used by apt-built simplejpeg/Picamera2 components. Trixie paths differ. This is a binary-compatibility issue between packages, not something solved by editing a color threshold. Do not indiscriminately install the newest NumPy into the recovered system.

From pixels to behavior

Color-following reads detect_obj_parameter fields such as color_n, color_x and color_w. Count indicates a detection condition; X gives a pixel location; width supplies an image-size cue. The bull-fight example steers by horizontal position and moves forward when in its center band. It does not fuse sonar, estimate range from calibrated optics, or enforce a distance-based stop. The treasure-hunt example is keyboard-guided and considers a large target blob a successful find. It is not autonomous QR navigation.

The current bull-fight thresholds are 100 and 220 pixels while the default image width is 640. This mismatch must be reviewed against the actual detection frame rather than presented as validated centering. Camera flip settings, exposure, color thresholds and target scale also change behavior. A future follower should normalize X by image width, require fresh detections, define a lost-target state and place collision supervision ahead of forward commands.

Headless developer arrangement

Run the source on the Pi through a Remote SSH terminal and use Vilib.display(local=False,web=True) for the camera. View /mjpg through port 9000 in the laptop browser, preferably via SSH forwarding on a shared network. Local OpenCV display requires a Pi-side graphical environment; Windows showing a VS Code editor does not itself provide a remote GUI display. Source inspection establishes routes and defaults, not that any stream is currently available.

Source evidence: vi-core, vi-install, vi-changelog, vi-detection, pc-bull-fight, pc-treasure, pc-control-api, pc-camera-doc, pi-camera.

Vision: projects, pipelines and performance gates

The stock camera is a valuable perception source after recovery. Capture, detection and behavior are different components. Vilib handles camera/model plumbing; member Python should normally select behavior. Keep one camera owner and distribute timestamped frames/results, rather than letting several projects independently instantiate Picamera2.

What level of work is involved?

IdeaSupport classDifficultyFun / engineering value (editorial 1–5)First useful output
Remote camera/snapshot stationSTOCK EXAMPLE → minor customizationBeginner/intermediate3 / 4Verified stream/file with timestamp and lifecycle
Color hunter / red-target followerSTOCK EXAMPLE → custom supervisionIntermediate5 / 5Normalized target-center trace plus range veto
Face-facing robotMINOR CUSTOMIZATIONBeginner/intermediate4 / 3Detection-to-turn with cooldown; no identity recognition
QR reader / action tokensDecoder stock, CUSTOM APPLICATIONIntermediate5 / 5Allowlisted token event and deduplicated mission progress
QR scavenger huntCUSTOM APPLICATIONIntermediate5 / 5Checkpoint state and loss handling, not room coordinates
Visual reaction gameCUSTOM APPLICATIONBeginner after prerequisites5 / 3Card/pose match and latency record
Event-triggered captureCUSTOM APPLICATION; recorder reviewIntermediate3 / 5Readable media linked to event telemetry
Camera telemetry dashboardCUSTOM APPLICATIONIntermediate3 / 5Frame age, capture/process FPS and model state
Object detector/followerMODEL/RUNTIME RESEARCH REQUIREDAdvanced5 / 5Qualified detector on recorded scenes before motion
Person follow-meMODEL/RESEARCH REQUIREDAdvanced/semester5 / 5Association and target-loss evidence, supervised approach
Gesture interactionHand landmarks conditional; CUSTOM GESTURE RULESAdvanced5 / 4Stable gesture state without actuating
Patrol cameraCUSTOM APPLICATION; course/localization gatesAdvanced/semester4 / 5Operator-supervised checkpoint mission trace
Calibrated landmark poseCUSTOM APPLICATION / RESEARCHAdvanced4 / 5Camera-relative pose with calibration/error record

Scores are qualitative authoring priorities, not measured user preferences. No added electronics are inherently required for these camera paths, but printed targets, storage, model assets or a compatible runtime may be required. Added microphone is a voice input requirement, not a camera feature. A depth camera is a separate hardware expansion.

A flagship tracker in stages

First show image/detection overlay only. Log color_n/x/w/h with actual width, flip and application frame identity. Then compute normalized image error and turn left/right with a deadband. Verify steering sign in a supported test, add a lost-target timeout and choose a target consistently. Next replace binary thresholds with proportional bounded turn selections and filtered error. Filtering reduces noise but adds lag, so retain raw error and timing. Only then add approach: stable centered target, fresh valid range, short segment, reobserve.

Target apparent size can trigger a rough near/far heuristic only for a particular target/scene. Object width changes with orientation, focal length and cropping; it is not a universal range measurement. For camera-plus-range fusion, establish extrinsic alignment and target/echo association. Evaluate reacquisition, competing targets, glare, blur and disappearance, rather than counting one successful follow as a reliable autonomous robot.

QR, gesture and patrol details

QR payload → bounded token parser → allowlist → mission state → proposed command → supervisor. Require token length limits, dwell and removal/rearm or mission-index deduplication. Do not execute Python/shell from a marker. In particular, stock action lookup uses eval internally, so mapping external text straight to an action is inappropriate. A QR checkpoint needs no metric pose claim; calibrated corner-based landmark pose is a distinct project.

Gesture input uses actual hands_detect_switch and hands_joints, then club geometry/classification rules, confidence/dwell and a neutral rearm state. MediaPipe landmarks are not a tested gesture recognizer. pose_detect_switch estimates a person's landmarks, not crawler body attitude. Face detection is a face-presence/localization cue, not identity recognition.

Patrol is a supervised mission along a reviewed level course. The first version can be teleoperated between photo stops. A later QR checkpoint runner needs explicit lost-marker and stale-video behavior. Calling a moving camera a security robot does not establish navigation or monitoring reliability. Store only appropriate experiment media with retention limits and space checks; recordings are not automatically public website assets.

Beyond Vilib

Use recorded frames to qualify an owned OpenCV path before involving motion. ArUco marker detection plus calibrated intrinsics/known marker scale can estimate relative pose; solvePnP/frame transforms require version-specific API review. Optical flow can measure image motion but is affected by scene depth, robot rotation and blur; it is not stock metric odometry. Human pose/custom detectors can use selected TFLite, ONNX or other runtimes only after actual arm64/Python/model support is checked. No ONNX model throughput, NPU presence or heavy detector feasibility is asserted here.

The pinned installer skips MediaPipe and tflite-runtime on Python>=3.13, and MediaPipe also requires 64-bit. Qualify a spare environment rather than downgrade/reinstall the preserved card impulsively. Models, labels and cascades may live in /opt/vilib; code install alone is insufficient. Record model format, preprocessing, labels, input size, asset hash, runtime, OS/Python and measured latency/memory. The Pi has 4GB shared with Linux, camera buffers and development services. Offboard inference trades compute headroom for transport delay, privacy and link-failure behavior.

The current camera_start waits without a failure deadline; import initializes Picamera2; close/restart is not established as reusable. A future manager needs bounded startup, fresh-frame evidence and a recovery policy. The source recorder's tight loop can write the same latest frame repeatedly, has no explicit pacing, and contains comparison expressions where flag-clearing assignments appear intended. These are source-review findings, not measured corruption. For real event video, validate cadence, timestamps, writer close, file readability and disk-full handling, or use an application-owned writer.

Source evidence: vi-core, vi-install, vi-detection, pc-bull-fight, pc-treasure, opencv-markers. Project records p2-color-hunter through p2-vision-game contain distinct implementation and acceptance paths.

Continue

Meeting checklist · Source library · Modification atlas · All project proposals