Capture Color Image
SUMMARY
Capture Color Image acquires one color image from the camera and returns it as a NumPy array, ready to be logged, processed, or saved. It is the simplest operation against any 2D or 3D camera and the foundation of vision pipelines that don't need continuous streaming.
Available on: IDS, Webcam, Intel RealSense, Zivid.
The Skill
python
image = camera.capture_color_image()Example
IDS

Webcam

Intel RealSense

Zivid

The Code
python
"""
Connect to a webcam, capture a color image, and disconnect.
Run from a terminal to avoid issues with Rerun's spawn mode.
"""
from loguru import logger
import rerun as rr
from telekinesis.medulla.cameras import webcam
def main():
camera = webcam.Webcam(
name="my_webcam_camera",
camera_id=0,
)
try:
rr.init("Webcam_Color_Image_Example", spawn=True)
camera.connect()
color_image = camera.capture_color_image()
rr.log("Color_Image_Capture", rr.Image(color_image))
except Exception as e:
logger.error(
f"Unable to capture color image. Caught exception: {type(e).__name__}: {e}"
)
finally:
rr.disconnect()
camera.disconnect()
if __name__ == "__main__":
main()python
"""
Connect to an IDS camera, get/set parameters, capture a color image, and disconnect.
Run from a terminal to avoid issues with Rerun's spawn mode.
"""
from loguru import logger
import rerun as rr
from telekinesis.medulla.cameras import ids
def main():
camera = ids.IDS(
name="my_ids_camera",
serial_number="4108909352",
load_factory_defaults=False,
)
try:
rr.init("IDS_Color_Image_Example", spawn=True)
camera.connect()
logger.info(f"ExposureTime: {camera.get_parameter('ExposureTime')}")
camera.set_parameter("ExposureTime", 35000.0)
color_image = camera.capture_color_image()
rr.log("Color_Image_Capture", rr.Image(color_image))
except Exception as e:
logger.error(
f"Unable to capture color image. Caught exception: {type(e).__name__}: {e}"
)
finally:
rr.disconnect()
camera.disconnect()
if __name__ == "__main__":
main()python
"""
Connect to a RealSense camera, capture a color image, and disconnect.
Run from a terminal to avoid issues with Rerun's spawn mode.
"""
from loguru import logger
import rerun as rr
from telekinesis.medulla.cameras import realsense
def main():
camera = realsense.RealSense(
name="my_realsense_camera"
)
try:
rr.init("RealSense_Color_Image_Example", spawn=True)
camera.connect()
color_image = camera.capture_color_image()
rr.log("Color_Image_Capture", rr.Image(color_image))
except Exception as e:
logger.error(
f"Unable to capture color image. Caught exception: {type(e).__name__}: {e}"
)
finally:
rr.disconnect()
camera.disconnect()
if __name__ == "__main__":
main()python
"""
Connect to a Zivid camera, capture a color image, and disconnect.
Run from a terminal to avoid issues with Rerun's spawn mode.
"""
from loguru import logger
import rerun as rr
from telekinesis.medulla.cameras import zivid
def main():
camera = zivid.Zivid(name="my_zivid_camera")
try:
rr.init("Zivid_Color_Image_Example", spawn=True)
camera.connect()
color_image = camera.capture_color_image()
rr.log("Color_Image_Capture", rr.Image(color_image))
except Exception as e:
logger.error(
f"Unable to capture color image. Caught exception: {type(e).__name__}: {e}"
)
finally:
rr.disconnect()
camera.disconnect()
if __name__ == "__main__":
main()Running the Example
Change to the respective camera examples folder in telekinesis-examples and run
bash
python capture_color_image.pyA Rerun viewer opens automatically. The captured image appears under Color_Image_Capture once acquisition completes.
Parameter Configuration
This method takes no parameters.
Returns
| Type | Description |
|---|---|
| Image (NumPy-backed) | RGB image of shape (H, W, 3), uint8. Can be converted to a NumPy array and passed directly to rr.Image. |
None | Only possible in principle if a driver skips a transient, recoverable frame; none of IDS, Webcam, RealSense, or Zivid currently return None — each raises instead. |
Raises
| Exception | Condition |
|---|---|
RuntimeError | Camera is not connected (IDS, Webcam, RealSense, Zivid) |
RuntimeError | Webcam only: the underlying VideoCapture failed to read a frame |
Where to Use the Skill
- Calibration and snapshot workflows — capture a single reference image to seed downstream processing.
- Triggered inspection — acquire one frame on demand instead of running a continuous stream.
- Pipelines that don't require video — feed Cornea or other vision modules with a single frame at a time.