Loading Image Stream Sources
Loading images from disk is fine.
However, usually you will deal with live images from stream. A stream can either be a streming device like a camera, or a video (form disk) or a emulated stream composed from single images you.
Here is how you load a EMU file, that can be used to simulate your application with a defined set of images.
- Add the main module to your script.
import cvb
- Streams are provided by devices.
emu_device = cvb.DeviceFactory.open(cvb.install_path() + "Tutorial\\ClassicSwitch.emu")
- Now you can get the stream and a special device image
stream = emu_device.stream
device_image = emu_device.device_image
- Finally print some information.
print("Emu:")
print("Resolution: " + str(device_image.width) + " x " + str(device_image.height))
print("Frames: " + str(stream.image_count))
The output would be:
Emu:
Resolution: 640 x 480
Frames: 5
Additional information can be found at CVB.NET. With CVBpy things are quite similar.