Skip to main content

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โ€‹

  1. Call RequestSingleImageFromDevice activity
  2. VAPIX client fetches the image (AWF format preferred, standard fallback)
  3. SingleImageStorageService stores the image + generates thumbnail
  4. Metadata is saved to Table Storage
  5. Image metadata is broadcast via SignalR to connected frontends
  6. Orchestration sleeps for the configured interval
  7. 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โ€‹

  1. The orchestration checks if the scheduled panoramic time has been reached
  2. If yes, switches from SINGLE to PANO mode
  3. Call RequestPanoFromDevice activity:
    • 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
  4. Component images are saved as a ZIP archive via PreStitchedImageStorageService
  5. Stitched panorama is saved via PanoImageStorageService
  6. 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โ€‹

  1. An operator requests a lease via the camera control queue
  2. The orchestration enters LEASED mode
  3. The command queue is checked for PTZ/focus/brightness commands
  4. Commands are executed as activity functions
  5. An image is captured after each command
  6. Idle timeout: If no commands are received for 1 minute, the lease closes
  7. 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โ€‹

  1. Turbo mode is activated via the Admin API or by a system event
  2. TurboModeFunctions delegates to IntervalAcquisitionFunctions with a reduced interval
  3. Images are captured at the turbo rate until turboEndTime expires
  4. 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โ€‹

FromToTrigger
SINGLEPANOScheduled panoramic time reached
PANOSINGLEPanoramic capture complete
SINGLELEASEDLease request via camera control queue
LEASEDSINGLE5-minute hard timeout
SINGLETURBOTurbo activation via Admin API
TURBOSINGLEturboEndTime expired

All mode transitions are managed by OrchestrationModeHelper and persisted on the CameraState durable entity.