![]() |
IDS peak IPL v1.12.1
|
IDS peak IPL (Image Processing Library) is an object-oriented C++ library that provides special functionality for processing image data. The IDS peak IPL can be used, for example, to convert raw bayer images from the camera that were captured via the IDS peak genericAPI into color (debayering).
All IDS peak IPL classes support shallow copying. Copying increases the internal reference count of an instance and deleting decreases it. If all object referencing the same instance are destroyed, the instance gets destroyed too. Changing values on one object, also changes the value on the underlying instance, which gets reflected on all objects referencing the same instance.
By default, this library is linked into the user program, therefore is loaded statically at program start. Instead, it can also be loaded dynamically, when the first library function is called. To use this feature, enable the CMake option PEAK_IPL_DYNAMIC_LOADING or set the #define PEAK_IPL_DYNAMIC_LOADING before including any of the libraries files.
The packed pixel formats, denoted by a p in their name, cannot be used by the majority of functions in the library. They must be unpacked to their unpacked counterpart first. So for example, the PixelFormat peak::ipl::PixelFormatName::Mono10p has to be unpacked first to its counterpart peak::ipl::PixelFormatName::Mono10 (note the missing p here) to be used by e.g. the Gain class. So the correct handling if the packed image already exists with the variable name packedImage is as follows:
or using the Converter class for better performance:
For Windows, there is also a .NET version of the library.
To use it in a C# project, add a reference to the ids_peak_ipl_dotnet.dll to the project.
Before starting your application, make sure that the DLL-Loader can find all required libraries. This means that ids_peak_ipl_dotnet.dll, ids_peak_ipl_dotnet_interface.dll and ids_peak_ipl.dll are located next to your application binary or that the directory where they are located is added to the DLL-Loader's search directories. To add their directory to the DLL-Loader's search directories, you could simply append their directory to the environment variable Path:
The IDS peak IPL .NET works much like the IDS peak IPL C++. The same principles, class and method names apply.
To use IDS peak IPL in Python, the ids_peak_ipl package can be installed directly from PyPI via pip, Python's package manager:
pip must be installed in version 20.3 or greater. Otherwise pip will detect the wheel as "not supported on this platform".In case of an offline installation, there is a separate Python wheel for each supported Python version and CPU architecture. A Python wheel is a package file (with .whl file ending) which can be installed via pip, Python's package manager. Just call pip install <Path-To-Python-Wheel> to install your chosen Python wheel. The respective .whl file can be obtained from the package's PyPI project page under Download files.
While pip will inform you about missing packages and their version requirements, contrary to the online installation, you need to manually resolve dependencies and respect the correct order of installation.
To finally use IDS peak IPL in your Python script, just add import ids_peak_ipl.ids_peak_ipl or import ids_peak_ipl.ids_peak_ipl as some_alias at the top of your Python script. The latter should be preferred.
The Python API works much like the C++ API. Nearly the same principles, class and method names apply.
There are only a few differences between the C++ API and the Python API. The most important ones are listed here.
Since Python had no native concept of enumeration types, the values are mapped to individual constants. A rule of thumb is that each scope resolution operator :: in C++ is replaced with an underscore in Python:
While images are created directly using the constructor of peak::ipl::Image in C++:
Helper functions are the preferred way to create images in Python, although it is possible to use the constructor directly, it is less convenient.