Acquisition Modes
The Image Acquisition Engine supports four distinct acquisition modes. Each orchestration loop checks the current mode and delegates to the appropriate handler.
Mode Overviewโ
SINGLE Modeโ
Handler: StandardModeFunctions
The default mode. Captures a single image from the camera at a configured interval.
Flowโ
- Call
RequestSingleImageFromDeviceactivity - VAPIX client fetches the image (AWF format preferred, standard fallback)
SingleImageStorageServicestores the image + generates thumbnail- Metadata is saved to Table Storage
- Image metadata is broadcast via SignalR to connected frontends
- Orchestration sleeps for the configured interval
- Loop repeats
Image Routingโ
The activity function routes based on device type:
- Real cameras โ VAPIX client (
IVAPIXClient.GetAWFImageAsync()) - Simulated cameras โ HTTP request to the Mock Camera API
PANO Modeโ
Handler: StandardModeFunctions
Captures multiple images from different PTZ positions and stitches them into a panoramic image.
Flowโ
- The orchestration checks if the scheduled panoramic time has been reached
- If yes, switches from SINGLE to PANO mode
- Call
RequestPanoFromDeviceactivity:- Internal pano: Captures 6+ images at different pan positions, stitches them using
System.Drawing(JPEG quality 50) - External pano (UCSD): Fetches from UCSD Alert CA API, re-stitches with corrected orientation
- Internal pano: Captures 6+ images at different pan positions, stitches them using
- Component images are saved as a ZIP archive via
PreStitchedImageStorageService - Stitched panorama is saved via
PanoImageStorageService - After completion, mode transitions back to SINGLE
Stitchingโ
Images are stitched horizontally using Graphics.DrawImage(). The resulting panorama width equals the sum of all component image widths.
LEASED Modeโ
Handler: LeaseModeFunctions
Manual control mode where external users (frontend operators) take direct control of a camera's PTZ.
Flowโ
- An operator requests a lease via the camera control queue
- The orchestration enters LEASED mode
- The command queue is checked for PTZ/focus/brightness commands
- Commands are executed as activity functions
- An image is captured after each command
- Idle timeout: If no commands are received for 1 minute, the lease closes
- Hard timeout: After 5 minutes total, mode returns to SINGLE
Why Leased Mode Existsโ
Live camera control needs immediate response. In SINGLE mode, the orchestration might be sleeping for 10+ seconds between captures. LEASED mode reduces the loop interval so PTZ commands are picked up and executed with minimal delay.
TURBO Modeโ
Handler: TurboModeFunctions โ delegates to IntervalAcquisitionFunctions
High-speed capture mode for urgent situations (e.g., active wildfires) where images need to be captured more frequently than the standard rate.
Flowโ
- Turbo mode is activated via the Admin API or by a system event
TurboModeFunctionsdelegates toIntervalAcquisitionFunctionswith a reduced interval- Images are captured at the turbo rate until
turboEndTimeexpires - When the timer expires, mode transitions back to SINGLE
Key Difference from SINGLEโ
TURBO uses a shorter, fixed interval regardless of the camera's configured acquisition rate. This provides maximum image freshness during critical events.
Mode Transition Summaryโ
| From | To | Trigger |
|---|---|---|
| SINGLE | PANO | Scheduled panoramic time reached |
| PANO | SINGLE | Panoramic capture complete |
| SINGLE | LEASED | Lease request via camera control queue |
| LEASED | SINGLE | 5-minute hard timeout |
| SINGLE | TURBO | Turbo activation via Admin API |
| TURBO | SINGLE | turboEndTime expired |
All mode transitions are managed by OrchestrationModeHelper and persisted on the CameraState durable entity.