Swift Imaging cameras¶
The SwiftCamDevice operator captures live video from a Swift Imaging scientific USB camera and exposes it as a TiXL Texture2D. It uses the vendor SDK directly (not DirectShow), which gives you hardware ROI, manual exposure, and color delivery at the camera's native resolution.
This page covers a one-time setup: where to put the SDK's swiftcam.dll so TiXL can find it, plus how to verify the camera is working.
What you need¶
- A Swift Imaging camera connected over USB 3.x (USB 2.0 may enumerate but the SDK can refuse to stream).
- The Swift Imaging SDK, version 3.0 or later. The vendor distributes this with the camera or as a separate download.
- TiXL running with the
Liboperator package available.
Install swiftcam.dll¶
swiftcam.dll is the vendor's native camera driver. TiXL is not allowed to redistribute it (the vendor's SDK ships no redistribution license), so you copy it once into a per-user folder.
- From the Swift Imaging SDK, locate
swiftcam.dllunderwin/x64/. Use the x64 build, not x86 β TiXL is a 64-bit process and will reject the x86 version with aBadImageFormatException. - Create the folder
%LOCALAPPDATA%\TiXL\NativeDeps\if it doesn't exist. In Explorer that's typicallyC:\Users\<you>\AppData\Local\TiXL\NativeDeps\. - Copy
swiftcam.dllinto that folder. The expected path is: - Connect the camera. The vendor's USB driver (
swiftcam.inf/swiftcam.catfrom the SDK) should already be installed; if Windows shows the camera as an unknown device in Device Manager, install the driver from the SDK first. - Restart TiXL (or trigger Reconnect on an existing
SwiftCamDeviceinstance).
If you'd rather keep the DLL elsewhere, set the environment variable TIXL_SWIFTCAM_DLL to its full path. The operator checks that variable first.
Verify the install¶
- Drop a
SwiftCamDeviceoperator into a composition. - Open the Device Name dropdown. You should see your camera listed by its product name (for example
Swiftcam_SC1003). - Pick the camera and toggle Active on. The Status output should change to
Streaming.. - Wire Texture into a viewer β
Layer 2 d,Display, or any operator that renders aTexture2D. Live video appears.
If the dropdown shows swiftcam.dll not found, the DLL isn't where the operator is looking. Re-check the path from step 3 above, then trigger Reconnect.
If the dropdown shows No Swift cameras found, the SDK is loading but no camera is detected. Check Device Manager β the camera should appear under its own category and not as Unknown USB Device. Replug the cable, or run the vendor's Swift Imaging app to confirm the OS sees the camera; close the vendor app before retrying TiXL (most camera SDKs only allow one process to hold the camera).
Tuning the live stream¶
SwiftCamDevice ships with sensible defaults. Three knobs matter most for live performance:
Resolution β the dropdown lists every preset the camera reports, with actual pixel dimensions (e.g. 0: 3664x2748 (full), 1: 1832x1374). Higher indices are typically binned/downsampled and run faster. Full-sensor 10 MP at 30 fps over USB 3.0 is not possible β the bandwidth is roughly 1.2 GB/s, beyond practical USB 3.0 throughput. For real-time preview, pick a lower resolution.
Auto Exposure β on by default, matching the camera's own default. Off lets the Exposure input take effect (in milliseconds). Lower exposure β faster maximum frame rate (1 / exposure_ms Γ 1000) β darker images.
Region of Interest (ROI) β set Roi Resolution to a non-zero (W, H) to crop the sensor in hardware. Roi Alignment (-1..1 per axis) places the crop window: (0, 0) = centered, (-1, -1) = top-left, (1, 1) = bottom-right. Snapped to multiples of 2 pixels for Bayer-pattern alignment.
Hardware ROI is unreliable on the Swiftcam_SC1003 (firmware 4.0.5). The SDK accepts
put_Roiand reportsEVENT_ROIconfirming the change, but no frames ever flow afterwards βEVENT_ERRORfires ~1 second later regardless of the ROI size or alignment. This is a firmware / SDK bug we can't work around in software. UseResolution Indexfor downsampled modes instead, then crop downstream in TiXL if you need a specific aspect ratio. Other Swift cameras (or a newer SC1003 firmware) may handle ROI correctly β the operator preserves the inputs in case yours does.
Recommended workflow for live preview at 30+ fps:
- Set
Resolution Index = 1(1832Γ1374, half-binned). Halves the data per frame. - Set
Auto Exposure = falseandExposure = 10ms or less. Frame rate is capped at1000 / exposure_ms. - Leave
Roi Resolution = (0, 0). - If you need a tighter region (e.g. 1080p), wire a software-crop or framebuffer operator after the texture output β at this resolution the GPU cost is negligible.
This gives ~50 fps on the SC1003 over USB 3.0.
Auto-recovery is built in: a USB hiccup, the camera being unplugged, or the SDK reporting an error all trigger a clean automatic reconnect roughly every second until the camera comes back. The Status output and the operator's status badge surface the current state.
Troubleshooting¶
swiftcam.dll not found β the file isn't at the expected path. Confirm with dir %LOCALAPPDATA%\TiXL\NativeDeps\swiftcam.dll from a command prompt. The file must be x64 (~12 MB).
Bad image format in the editor log β you copied the x86 build by mistake. Replace with x64.
Camera reported an error. Auto-retryingβ¦ β the SDK can occasionally fail to start streaming on a fresh Open(). The operator retries every second; usually it self-heals within a few attempts. If it persists, trigger Reconnect, or unplug and replug the camera physically.
Camera disconnected β physical USB drop, cable issue, or the vendor app stole the handle. Plug back in and the operator reconnects automatically.
Camera stops responding and Reconnect doesn't fix it β observed on the SC1003 after repeated put_Roi attempts: the camera firmware can enter a stuck state where neither Active = off/on nor Reconnect recovers it. Physically unplug and replug the USB cable to reset the device. The vendor's app exhibits the same behaviour, so this is firmware-side. Avoid configuring a non-zero Roi Resolution on the SC1003.
Frame rate lower than expected β check Exposure (manual) or scene brightness (auto). Long exposure caps frame rate. Then check the Resolution dropdown β full sensor at 10 MP is intrinsically bandwidth-limited.
Verbose log output filling up β the LogMessages input is on. Toggle it off; only errors and one-time lifecycle events log by default.
What this operator doesn't do¶
By design, SwiftCamDevice is the raw input β one job, no extras. Downstream operators handle:
- White balance, tone mapping, gamma β apply a regular image-processing chain.
- Dark-frame subtraction, temporal accumulation, denoising β pending dedicated operators; for now compose with existing image filters.
- 16-bit / RAW Bayer output β pending; the operator currently delivers 8-bit BGRA after the SDK's internal demosaic.
See also¶
- The TiXL operator browser to find image-processing operators that consume the texture.
- The vendor's product page for camera-specific specs (sensor size, exposure range, supported binning modes).