How sebsronnie/kounterplusplus works
Kounter++ is an openFrameworks desktop app for counting, measuring, classifying, and tracking objects in still images and live video. Users load an image, webcam, or video, tune segmentation and cleanup settings, then inspect the mask or overlay; they can teach labels, reset tracking, save screenshots, and export measurements. The app coordinates interchangeable frame sources, converts pixels through a bridge, and sends frames to an OpenCV detector whose documented stages segment, analyse, classify, and track objects. Source-level evidence is partial, so uncertain links are omitted or marked unverified.
Main entry points: ofApp.cpp App Coordinator · ObjectDetector.cpp Object Detector · FrameSource.h Frame Source Interface · CameraSource.cpp Camera Source
Components 19
Application and UI
- App Coordinator
src/ofApp.cpp - Control Panel
src/app/ControlPanel.cpp - OpenCV Bridge
src/app/CvBridge.cpp
Frame Sources
- Frame Source Interface
src/sources/FrameSource.h - Image Source
src/sources/ImageSource.cpp - Camera Source
src/sources/CameraSource.cpp - Video File Source
src/sources/VideoFileSource.cpp
Vision Pipeline
- Object Detector
src/vision/ObjectDetector.cpp - Detection Settings
src/vision/DetectionSettings.h - Segmentation and Cleanup
src/vision/Segmenter.cpp - Contour Measurement
src/vision/ContourAnalyser.cpp - Detected Object Data
src/vision/DetectedObject.h - Object Classifier
src/vision/ObjectClassifer.cpp - Video Tracker
src/vision/ObjectTracker.cpp
Results and Export
- Result Overlay
src/app/ResultOverlay.cpp
Other components
- User
- Image and Video Files
- Webcam
- Screenshot and CSV Files
Connections 28
- User → App Coordinator: operates
README.md - App Coordinator → Control Panel: configures
src/ofApp.cpp - Control Panel → Detection Settings: updates
- App Coordinator → Detection Settings: reads
src/ofApp.cpp - App Coordinator → Image Source: opens
src/ofApp.cpp - App Coordinator → Video File Source: opens
src/ofApp.cpp - App Coordinator → Camera Source: opens
- Image and Video Files → App Coordinator: provides input
README.md - Webcam → Camera Source: provides frames
- Image Source → Frame Source Interface: implements
- Camera Source → Frame Source Interface: implements
- Video File Source → Frame Source Interface: implements
- App Coordinator → Frame Source Interface: updates
src/ofApp.cpp - App Coordinator → OpenCV Bridge: converts pixels
src/ofApp.cpp - App Coordinator → Object Detector: processes frame
src/ofApp.cpp - Object Detector → Detection Settings: uses
- Object Detector → Segmentation and Cleanup: segments
- Object Detector → Contour Measurement: analyses contours
- Object Detector → Object Classifier: classifies
- Object Detector → Video Tracker: tracks
- Contour Measurement → Detected Object Data: produces measurements
- Object Classifier → Detected Object Data: labels
- Video Tracker → Detected Object Data: assigns track IDs
- App Coordinator → Object Classifier: teaches clicked object
src/ofApp.cpp - App Coordinator → Video Tracker: resets counter
src/ofApp.cpp - App Coordinator → Result Overlay: draws results
src/ofApp.cpp - Result Overlay → User: shows counts and overlay
README.md - App Coordinator → Screenshot and CSV Files: saves screenshot and CSV
src/ofApp.cpp