![]() |
IDS peak ICV v1.2.0
|
This tutorial introduces the basics of acquiring and processing images using the ICV Python interface.
Before retrieving or processing images, ensure the following requirements are met:
Camera connection
Confirm that a IDS camera is properly connected to your system and capable of acquiring images.
Open DataStream
To receive image data, you must open a DataStream using the IDS peak genericAPI. This step is essential because the raw image buffers come from the IDS peak genericAPI, not the ICV interface. For details on opening a DataStream, see the IDS peak genericAPI documentation.
Python interface
Make sure the ICV Python interface is installed on your system.
Import the following modules, as they are required for the example below:
DefaultPipeline Provides the image processing pipeline that converts raw acquisition data into usable images.PixelFormat An enumeration of available pixel formats. used to specify the desired format of the output image.Note: Pixel formats are a shared concept across the IDS Peak SDK.
They are used by IDS peak genericAPI, IDS peak ICV, and other components. To keep them consistent and reusable, they are defined in the ids_peak_common module.
The IDS peak ICV Python interface uses an image pipeline to process raw acquisition data into usable images. This pipeline handles tasks such as image format conversion and preprocessing, ensuring the resulting image is ready for further analysis.
The example below demonstrates how to retrieve an image using this pipeline, assuming that a DataStream object is available:
Note: By default, the pipeline outputs a color image (RGB), also for monochrome cameras. Set the output format to PixelFormat.MONO_8 for monochrome cameras as well.
As an initial processing step, apply a threshold to isolate bright pixels within the acquired image:
This operation produces a region representing all pixels within the specified gray value range, which can be used for further analysis.
You can analyze the extracted region by measuring its area: